From: Eli Zaretskii Date: Fri, 29 Aug 2008 10:08:26 +0000 (+0000) Subject: (Fexpand_file_name): Copy argument `name' into local storage on all platforms, X-Git-Tag: emacs-pretest-22.2.92~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=565f0b98c20501d33d8f8112891d72888b559b67;p=emacs.git (Fexpand_file_name): Copy argument `name' into local storage on all platforms, not just on DOS_NT. --- diff --git a/src/ChangeLog b/src/ChangeLog index 3faea824ff0..9bab3609af6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-08-29 Eli Zaretskii + + * fileio.c (Fexpand_file_name): Copy argument `name' into local + storage on all platforms, not just on DOS_NT. + 2008-08-29 YAMAMOTO Mitsuharu * mac.c (mac_system_script_code): Use EMACS_INT for DEFVAR_INT variable. diff --git a/src/fileio.c b/src/fileio.c index 81836bd8213..d925543c8d1 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1149,11 +1149,10 @@ See also the function `substitute-in-file-name'. */) nm = SDATA (name); multibyte = STRING_MULTIBYTE (name); -#ifdef DOS_NT - /* We will force directory separators to be either all \ or /, so make - a local copy to modify, even if there ends up being no change. */ + /* Make a local copy of nm[] to protect it from GC in DECODE_FILE below. */ nm = strcpy (alloca (strlen (nm) + 1), nm); +#ifdef DOS_NT /* Note if special escape prefix is present, but remove for now. */ if (nm[0] == '/' && nm[1] == ':') { @@ -1340,7 +1339,7 @@ See also the function `substitute-in-file-name'. */) } return name; #else /* not DOS_NT */ - if (nm == SDATA (name)) + if (strcmp (nm, SDATA (name)) == 0) return name; return make_specified_string (nm, -1, strlen (nm), multibyte); #endif /* not DOS_NT */