comparison src/fileio.c @ 19695:d28bbba0fcd0

(Fexpand_file_name) [WINDOWSNT]: When stripping drive letter, be careful not to create a UNC filename. (Fadd_name_to_file) [WINDOWSNT]: Remove conditional.
author Geoff Voelker <voelker@cs.washington.edu>
date Wed, 03 Sep 1997 00:30:24 +0000
parents d206d8b146dc
children 380cbf03df01
comparison
equal deleted inserted replaced
19694:4a0cf10c12f2 19695:d28bbba0fcd0
915 while (--colon >= nm) 915 while (--colon >= nm)
916 if (colon[0] == ':') 916 if (colon[0] == ':')
917 goto look_again; 917 goto look_again;
918 } 918 }
919 } 919 }
920
921 #ifdef WINDOWSNT
922 /* If we see "c://somedir", we want to strip the first slash after the
923 colon when stripping the drive letter. Otherwise, this expands to
924 "//somedir". */
925 if (drive && IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1]))
926 nm++;
927 #endif /* WINDOWSNT */
920 #endif /* DOS_NT */ 928 #endif /* DOS_NT */
921 929
922 #ifdef WINDOWSNT 930 #ifdef WINDOWSNT
923 /* Discard any previous drive specifier if nm is now in UNC format. */ 931 /* Discard any previous drive specifier if nm is now in UNC format. */
924 if (IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1])) 932 if (IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1]))
2355 2363
2356 if (NILP (ok_if_already_exists) 2364 if (NILP (ok_if_already_exists)
2357 || INTEGERP (ok_if_already_exists)) 2365 || INTEGERP (ok_if_already_exists))
2358 barf_or_query_if_file_exists (newname, "make it a new name", 2366 barf_or_query_if_file_exists (newname, "make it a new name",
2359 INTEGERP (ok_if_already_exists), 0); 2367 INTEGERP (ok_if_already_exists), 0);
2360 #ifdef WINDOWSNT
2361 /* Windows does not support this operation. */
2362 report_file_error ("Adding new name", Flist (2, &file));
2363 #else /* not WINDOWSNT */
2364 2368
2365 unlink (XSTRING (newname)->data); 2369 unlink (XSTRING (newname)->data);
2366 if (0 > link (XSTRING (file)->data, XSTRING (newname)->data)) 2370 if (0 > link (XSTRING (file)->data, XSTRING (newname)->data))
2367 { 2371 {
2368 #ifdef NO_ARG_ARRAY 2372 #ifdef NO_ARG_ARRAY
2371 report_file_error ("Adding new name", Flist (2, args)); 2375 report_file_error ("Adding new name", Flist (2, args));
2372 #else 2376 #else
2373 report_file_error ("Adding new name", Flist (2, &file)); 2377 report_file_error ("Adding new name", Flist (2, &file));
2374 #endif 2378 #endif
2375 } 2379 }
2376 #endif /* not WINDOWSNT */
2377 2380
2378 UNGCPRO; 2381 UNGCPRO;
2379 return Qnil; 2382 return Qnil;
2380 } 2383 }
2381 2384