aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-04-18 02:26:05 +0000
committerStefan Monnier2008-04-18 02:26:05 +0000
commit8ee085a488bc50e3d2c77b6b674de7992edee39b (patch)
treee96688b6a429dcc22c0bbd540c6ed7a2d408d9c1
parentce20300145fc056032105014adaa887379b00395 (diff)
downloademacs-8ee085a488bc50e3d2c77b6b674de7992edee39b.tar.gz
emacs-8ee085a488bc50e3d2c77b6b674de7992edee39b.zip
(Fexpand_file_name): Refine last fix so `nm' is only
relocated if it points to `name'.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fileio.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 527ff3c689d..0b849d99c43 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * fileio.c (Fexpand_file_name): Refine last fix so `nm' is only
4 relocated if it points to `name'.
5
12008-04-17 Kenichi Handa <handa@m17n.org> 62008-04-17 Kenichi Handa <handa@m17n.org>
2 7
3 * data.c (Faset): Allow setting a multibyte character in an 8 * data.c (Faset): Allow setting a multibyte character in an
diff --git a/src/fileio.c b/src/fileio.c
index 498d2bb192b..6c8db062be8 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1045,6 +1045,7 @@ See also the function `substitute-in-file-name'. */)
1045 /* These point to SDATA and need to be careful with string-relocation 1045 /* These point to SDATA and need to be careful with string-relocation
1046 during GC (via DECODE_FILE). */ 1046 during GC (via DECODE_FILE). */
1047 unsigned char *nm, *newdir; 1047 unsigned char *nm, *newdir;
1048 int nm_in_name;
1048 /* This should only point to alloca'd data. */ 1049 /* This should only point to alloca'd data. */
1049 unsigned char *target; 1050 unsigned char *target;
1050 1051
@@ -1158,11 +1159,13 @@ See also the function `substitute-in-file-name'. */)
1158 } 1159 }
1159 1160
1160 nm = SDATA (name); 1161 nm = SDATA (name);
1162 nm_in_name = 1;
1161 1163
1162#ifdef DOS_NT 1164#ifdef DOS_NT
1163 /* We will force directory separators to be either all \ or /, so make 1165 /* We will force directory separators to be either all \ or /, so make
1164 a local copy to modify, even if there ends up being no change. */ 1166 a local copy to modify, even if there ends up being no change. */
1165 nm = strcpy (alloca (strlen (nm) + 1), nm); 1167 nm = strcpy (alloca (strlen (nm) + 1), nm);
1168 nm_in_name = 0;
1166 1169
1167 /* Note if special escape prefix is present, but remove for now. */ 1170 /* Note if special escape prefix is present, but remove for now. */
1168 if (nm[0] == '/' && nm[1] == ':') 1171 if (nm[0] == '/' && nm[1] == ':')
@@ -1321,6 +1324,7 @@ See also the function `substitute-in-file-name'. */)
1321 if (index (nm, '/')) 1324 if (index (nm, '/'))
1322 { 1325 {
1323 nm = sys_translate_unix (nm); 1326 nm = sys_translate_unix (nm);
1327 nm_in_name = 0;
1324 return make_specified_string (nm, -1, strlen (nm), multibyte); 1328 return make_specified_string (nm, -1, strlen (nm), multibyte);
1325 } 1329 }
1326#endif /* VMS */ 1330#endif /* VMS */
@@ -1396,6 +1400,7 @@ See also the function `substitute-in-file-name'. */)
1396 int offset = nm - SDATA (name); 1400 int offset = nm - SDATA (name);
1397 hdir = DECODE_FILE (tem); 1401 hdir = DECODE_FILE (tem);
1398 newdir = SDATA (hdir); 1402 newdir = SDATA (hdir);
1403 if (nm_in_name)
1399 nm = SDATA (name) + offset; 1404 nm = SDATA (name) + offset;
1400 } 1405 }
1401#ifdef DOS_NT 1406#ifdef DOS_NT