aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-01 02:23:06 +0000
committerRichard M. Stallman1996-06-01 02:23:06 +0000
commit576760910b5dc7d5dd06345a40088fbdd08e2bab (patch)
treeba9b870d4799d82c86483367de5adce4f0c0bf74
parent651939b595890a5f85bb876dc03a1038b0e66325 (diff)
downloademacs-576760910b5dc7d5dd06345a40088fbdd08e2bab.tar.gz
emacs-576760910b5dc7d5dd06345a40088fbdd08e2bab.zip
(Fexpand_file_name) [WINDOWSNT]: Don't strip trailing /
when newdir is just "//". (Ffile_name_directory) [WINDOWSNT]: Return Qnil if filename is a partial UNC name such as "//foo".
-rw-r--r--src/fileio.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index f979cb2ab48..062f75ede81 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -348,6 +348,12 @@ on VMS, perhaps instead a string ending in `:', `]' or `>'.")
348 348
349 if (p == beg) 349 if (p == beg)
350 return Qnil; 350 return Qnil;
351#ifdef WINDOWSNT
352 /* We can consider the partial UNC name //machine to be a
353 directory name, but not just // on its own. */
354 if (p == beg + 1 && IS_DIRECTORY_SEP (p[-1]))
355 return Qnil;
356#endif
351#ifdef DOS_NT 357#ifdef DOS_NT
352 /* Expansion of "c:" to drive and default directory. */ 358 /* Expansion of "c:" to drive and default directory. */
353 if (p == beg + 2 && beg[1] == ':') 359 if (p == beg + 2 && beg[1] == ':')
@@ -1252,9 +1258,14 @@ See also the function `substitute-in-file-name'.")
1252 1258
1253 if (newdir) 1259 if (newdir)
1254 { 1260 {
1255 /* Get rid of any slash at the end of newdir. */ 1261 /* Get rid of any slash at the end of newdir, unless newdir is
1262 just // (an incomplete UNC name). */
1256 length = strlen (newdir); 1263 length = strlen (newdir);
1257 if (IS_DIRECTORY_SEP (newdir[length - 1])) 1264 if (IS_DIRECTORY_SEP (newdir[length - 1])
1265#ifdef WINDOWSNT
1266 && !(length == 2 && IS_DIRECTORY_SEP (newdir[0]))
1267#endif
1268 )
1258 { 1269 {
1259 unsigned char *temp = (unsigned char *) alloca (length); 1270 unsigned char *temp = (unsigned char *) alloca (length);
1260 bcopy (newdir, temp, length - 1); 1271 bcopy (newdir, temp, length - 1);