diff src/fileio.c @ 213:78f53ef88e17 r20-4b5

Import from CVS: tag r20-4b5
author cvs
date Mon, 13 Aug 2007 10:06:47 +0200
parents 78478c60bfcd
children 1f0dabaa0855
line wrap: on
line diff
--- a/src/fileio.c	Mon Aug 13 10:05:53 2007 +0200
+++ b/src/fileio.c	Mon Aug 13 10:06:47 2007 +0200
@@ -562,6 +562,9 @@
       out[size + 1] = DIRECTORY_SEP;
       out[size + 2] = '\0';
     }
+#ifdef DOS_NT
+  CORRECT_DIR_SEPS (out);
+#endif
   return out;
 }
 
@@ -768,7 +771,7 @@
 	    /* Detect MSDOS file names with drive specifiers. */
 	    && (IS_DRIVE (XSTRING_BYTE (default_, 0))
 		&& (IS_DEVICE_SEP (XSTRING_BYTE (default_, 1))
-		    IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 2)))))
+		    && IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 2)))))
 #ifdef WINDOWSNT
       /* Detect Windows file names in UNC format.  */
       && ! (XSTRING_LENGTH (default_) >= 2
@@ -2059,10 +2062,13 @@
 				  INTP (ok_if_already_exists), 0);
 /* Syncing with FSF 19.34.6 note: FSF does not report a file error
    on NT here. --marcpa */
-#if 0 /* defined(WINDOWSNT) */
+/* But FSF #defines link as sys_link which is supplied in nt.c. We can't do
+   that because sysfile.h defines sys_link depending on ENCAPSULATE_LINK.
+   Reverted to previous behaviour pending a working fix. (jhar) */
+#if defined(WINDOWSNT)
   /* Windows does not support this operation.  */
   report_file_error ("Adding new name", Flist (2, &filename));
-#else /* not 0 -- defined(WINDOWSNT) */
+#else /* not defined(WINDOWSNT) */
 
   unlink ((char *) XSTRING_DATA (newname));
   if (0 > link ((char *) XSTRING_DATA (filename),
@@ -2071,7 +2077,7 @@
       report_file_error ("Adding new name",
 			 list2 (filename, newname));
     }
-#endif /* 0 -- defined(WINDOWSNT) */
+#endif /* defined(WINDOWSNT) */
 
   UNGCPRO;
   return Qnil;