Skip to content

Commit

Permalink
(Fexpand_file_name): Copy argument `name' into local storage on all p…
Browse files Browse the repository at this point in the history
…latforms,

not just on DOS_NT.
  • Loading branch information
Eli-Zaretskii committed Aug 29, 2008
1 parent 083d915 commit 7e8e5fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/fileio.c
Expand Up @@ -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] == ':')
{
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 7e8e5fe

Please sign in to comment.