From: Geoff Voelker Date: Wed, 3 Sep 1997 00:30:24 +0000 (+0000) Subject: (Fexpand_file_name) [WINDOWSNT]: When stripping X-Git-Tag: emacs-20.1~253 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb1ff1f449fd50faf8a5d259b180d6e0f552af81;p=emacs.git (Fexpand_file_name) [WINDOWSNT]: When stripping drive letter, be careful not to create a UNC filename. (Fadd_name_to_file) [WINDOWSNT]: Remove conditional. --- diff --git a/src/fileio.c b/src/fileio.c index 6c021226514..fa7b51d7e9d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -917,6 +917,14 @@ See also the function `substitute-in-file-name'.") goto look_again; } } + +#ifdef WINDOWSNT + /* If we see "c://somedir", we want to strip the first slash after the + colon when stripping the drive letter. Otherwise, this expands to + "//somedir". */ + if (drive && IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1])) + nm++; +#endif /* WINDOWSNT */ #endif /* DOS_NT */ #ifdef WINDOWSNT @@ -2357,10 +2365,6 @@ This is what happens in interactive use with M-x.") || INTEGERP (ok_if_already_exists)) barf_or_query_if_file_exists (newname, "make it a new name", INTEGERP (ok_if_already_exists), 0); -#ifdef WINDOWSNT - /* Windows does not support this operation. */ - report_file_error ("Adding new name", Flist (2, &file)); -#else /* not WINDOWSNT */ unlink (XSTRING (newname)->data); if (0 > link (XSTRING (file)->data, XSTRING (newname)->data)) @@ -2373,7 +2377,6 @@ This is what happens in interactive use with M-x.") report_file_error ("Adding new name", Flist (2, &file)); #endif } -#endif /* not WINDOWSNT */ UNGCPRO; return Qnil;