+2009-07-07 Chong Yidong <cyd@stupidchicken.com>
+
+ * fileio.c (Fsubstitute_in_file_name): Copy string data properly.
+
2009-07-07 Kenichi Handa <handa@m17n.org>
* .gdbinit (xcharset): Fix the treating of $arg0.
if (!NILP (handler))
return call2 (handler, Qsubstitute_in_file_name, filename);
- nm = SDATA (filename);
/* Always work on a copy of the string, in case GC happens during
decode of environment variables, causing the original Lisp_String
data to be relocated. */
- nm = strcpy (alloca (strlen (nm) + 1), nm);
+ nm = (unsigned char *) alloca (SBYTES (filename) + 1);
+ bcopy (SDATA (filename), nm, SBYTES (filename) + 1);
+
#ifdef DOS_NT
CORRECT_DIR_SEPS (nm);
substituted = (strcmp (nm, SDATA (filename)) != 0);