comparison 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
comparison
equal deleted inserted replaced
212:d8688acf4c5b 213:78f53ef88e17
560 if (!IS_ANY_SEP (out[size])) 560 if (!IS_ANY_SEP (out[size]))
561 { 561 {
562 out[size + 1] = DIRECTORY_SEP; 562 out[size + 1] = DIRECTORY_SEP;
563 out[size + 2] = '\0'; 563 out[size + 2] = '\0';
564 } 564 }
565 #ifdef DOS_NT
566 CORRECT_DIR_SEPS (out);
567 #endif
565 return out; 568 return out;
566 } 569 }
567 570
568 DEFUN ("file-name-as-directory", Ffile_name_as_directory, 1, 1, 0, /* 571 DEFUN ("file-name-as-directory", Ffile_name_as_directory, 1, 1, 0, /*
569 Return a string representing file FILENAME interpreted as a directory. 572 Return a string representing file FILENAME interpreted as a directory.
766 && ! (XSTRING_LENGTH (default_) >= 3 769 && ! (XSTRING_LENGTH (default_) >= 3
767 #ifdef DOS_NT 770 #ifdef DOS_NT
768 /* Detect MSDOS file names with drive specifiers. */ 771 /* Detect MSDOS file names with drive specifiers. */
769 && (IS_DRIVE (XSTRING_BYTE (default_, 0)) 772 && (IS_DRIVE (XSTRING_BYTE (default_, 0))
770 && (IS_DEVICE_SEP (XSTRING_BYTE (default_, 1)) 773 && (IS_DEVICE_SEP (XSTRING_BYTE (default_, 1))
771 IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 2))))) 774 && IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 2)))))
772 #ifdef WINDOWSNT 775 #ifdef WINDOWSNT
773 /* Detect Windows file names in UNC format. */ 776 /* Detect Windows file names in UNC format. */
774 && ! (XSTRING_LENGTH (default_) >= 2 777 && ! (XSTRING_LENGTH (default_) >= 2
775 && IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 0)) 778 && IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 0))
776 && IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 1))) 779 && IS_DIRECTORY_SEP (XSTRING_BYTE (default_, 1)))
2057 || INTP (ok_if_already_exists)) 2060 || INTP (ok_if_already_exists))
2058 barf_or_query_if_file_exists (newname, "make it a new name", 2061 barf_or_query_if_file_exists (newname, "make it a new name",
2059 INTP (ok_if_already_exists), 0); 2062 INTP (ok_if_already_exists), 0);
2060 /* Syncing with FSF 19.34.6 note: FSF does not report a file error 2063 /* Syncing with FSF 19.34.6 note: FSF does not report a file error
2061 on NT here. --marcpa */ 2064 on NT here. --marcpa */
2062 #if 0 /* defined(WINDOWSNT) */ 2065 /* But FSF #defines link as sys_link which is supplied in nt.c. We can't do
2066 that because sysfile.h defines sys_link depending on ENCAPSULATE_LINK.
2067 Reverted to previous behaviour pending a working fix. (jhar) */
2068 #if defined(WINDOWSNT)
2063 /* Windows does not support this operation. */ 2069 /* Windows does not support this operation. */
2064 report_file_error ("Adding new name", Flist (2, &filename)); 2070 report_file_error ("Adding new name", Flist (2, &filename));
2065 #else /* not 0 -- defined(WINDOWSNT) */ 2071 #else /* not defined(WINDOWSNT) */
2066 2072
2067 unlink ((char *) XSTRING_DATA (newname)); 2073 unlink ((char *) XSTRING_DATA (newname));
2068 if (0 > link ((char *) XSTRING_DATA (filename), 2074 if (0 > link ((char *) XSTRING_DATA (filename),
2069 (char *) XSTRING_DATA (newname))) 2075 (char *) XSTRING_DATA (newname)))
2070 { 2076 {
2071 report_file_error ("Adding new name", 2077 report_file_error ("Adding new name",
2072 list2 (filename, newname)); 2078 list2 (filename, newname));
2073 } 2079 }
2074 #endif /* 0 -- defined(WINDOWSNT) */ 2080 #endif /* defined(WINDOWSNT) */
2075 2081
2076 UNGCPRO; 2082 UNGCPRO;
2077 return Qnil; 2083 return Qnil;
2078 } 2084 }
2079 2085