Mercurial > hg > xemacs-beta
comparison src/fileio.c @ 4982:3c3c1d139863
Automatic merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Fri, 05 Feb 2010 11:25:00 -0600 |
parents | 4aebb0131297 16112448d484 |
children | 44d7bde26046 |
comparison
equal
deleted
inserted
replaced
4981:4aebb0131297 | 4982:3c3c1d139863 |
---|---|
397 else | 397 else |
398 { | 398 { |
399 return Qnil; | 399 return Qnil; |
400 } | 400 } |
401 if (wd) | 401 if (wd) |
402 xfree (wd, Ibyte *); | 402 xfree (wd); |
403 } | 403 } |
404 | 404 |
405 #if 0 /* No! This screws up efs, which calls file-name-directory on URL's | 405 #if 0 /* No! This screws up efs, which calls file-name-directory on URL's |
406 and expects the slashes to be left alone. This is here because of | 406 and expects the slashes to be left alone. This is here because of |
407 an analogous call in FSF 21. */ | 407 an analogous call in FSF 21. */ |
940 name = build_istring (newnm); | 940 name = build_istring (newnm); |
941 XSTRING_DATA (name)[0] = DRIVE_LETTER (drive); | 941 XSTRING_DATA (name)[0] = DRIVE_LETTER (drive); |
942 XSTRING_DATA (name)[1] = ':'; | 942 XSTRING_DATA (name)[1] = ':'; |
943 } | 943 } |
944 } | 944 } |
945 xfree (newnm, Ibyte *); | 945 xfree (newnm); |
946 RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, name); | 946 RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, name); |
947 } | 947 } |
948 #endif /* WIN32_FILENAMES */ | 948 #endif /* WIN32_FILENAMES */ |
949 #ifndef WIN32_NATIVE | 949 #ifndef WIN32_NATIVE |
950 if (nm == XSTRING_DATA (name)) | 950 if (nm == XSTRING_DATA (name)) |
1053 { | 1053 { |
1054 Ibyte *newcwd = mswindows_getdcwd (toupper (drive) - 'A' + 1); | 1054 Ibyte *newcwd = mswindows_getdcwd (toupper (drive) - 'A' + 1); |
1055 if (newcwd) | 1055 if (newcwd) |
1056 { | 1056 { |
1057 IBYTE_STRING_TO_ALLOCA (newcwd, newdir); | 1057 IBYTE_STRING_TO_ALLOCA (newcwd, newdir); |
1058 xfree (newcwd, Ibyte *); | 1058 xfree (newcwd); |
1059 } | 1059 } |
1060 else | 1060 else |
1061 newdir = NULL; | 1061 newdir = NULL; |
1062 } | 1062 } |
1063 #endif /* WIN32_NATIVE */ | 1063 #endif /* WIN32_NATIVE */ |
1139 #ifdef WIN32_NATIVE | 1139 #ifdef WIN32_NATIVE |
1140 Ibyte *newcwd = mswindows_getdcwd (toupper (drive) - 'A' + 1); | 1140 Ibyte *newcwd = mswindows_getdcwd (toupper (drive) - 'A' + 1); |
1141 if (newcwd) | 1141 if (newcwd) |
1142 { | 1142 { |
1143 IBYTE_STRING_TO_ALLOCA (newcwd, newdir); | 1143 IBYTE_STRING_TO_ALLOCA (newcwd, newdir); |
1144 xfree (newcwd, Ibyte *); | 1144 xfree (newcwd); |
1145 } | 1145 } |
1146 else | 1146 else |
1147 #endif | 1147 #endif |
1148 IBYTE_STRING_TO_ALLOCA ((Ibyte *) "/", newdir); | 1148 IBYTE_STRING_TO_ALLOCA ((Ibyte *) "/", newdir); |
1149 } | 1149 } |
1314 *o = '\0'; | 1314 *o = '\0'; |
1315 | 1315 |
1316 { | 1316 { |
1317 Ibyte *newtarget = mswindows_canonicalize_filename (target); | 1317 Ibyte *newtarget = mswindows_canonicalize_filename (target); |
1318 Lisp_Object result = build_istring (newtarget); | 1318 Lisp_Object result = build_istring (newtarget); |
1319 xfree (newtarget, Ibyte *); | 1319 xfree (newtarget); |
1320 | 1320 |
1321 RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, result); | 1321 RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, result); |
1322 } | 1322 } |
1323 #else /* not WIN32_FILENAMES */ | 1323 #else /* not WIN32_FILENAMES */ |
1324 RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, | 1324 RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, |
2550 buf = xnew_array_and_zero (Ibyte, bufsize); | 2550 buf = xnew_array_and_zero (Ibyte, bufsize); |
2551 valsize = qxe_readlink (XSTRING_DATA (filename), | 2551 valsize = qxe_readlink (XSTRING_DATA (filename), |
2552 buf, bufsize); | 2552 buf, bufsize); |
2553 if (valsize < bufsize) break; | 2553 if (valsize < bufsize) break; |
2554 /* Buffer was not long enough */ | 2554 /* Buffer was not long enough */ |
2555 xfree (buf, Ibyte *); | 2555 xfree (buf); |
2556 bufsize *= 2; | 2556 bufsize *= 2; |
2557 } | 2557 } |
2558 if (valsize == -1) | 2558 if (valsize == -1) |
2559 { | 2559 { |
2560 xfree (buf, Ibyte *); | 2560 xfree (buf); |
2561 return Qnil; | 2561 return Qnil; |
2562 } | 2562 } |
2563 val = make_string (buf, valsize); | 2563 val = make_string (buf, valsize); |
2564 xfree (buf, Ibyte *); | 2564 xfree (buf); |
2565 return val; | 2565 return val; |
2566 #elif defined (WIN32_NATIVE) | 2566 #elif defined (WIN32_NATIVE) |
2567 if (mswindows_shortcuts_are_symlinks) | 2567 if (mswindows_shortcuts_are_symlinks) |
2568 { | 2568 { |
2569 /* We want to resolve the directory component and leave the rest | 2569 /* We want to resolve the directory component and leave the rest |
2589 fname = mswindows_read_link (path); | 2589 fname = mswindows_read_link (path); |
2590 if (!fname) | 2590 if (!fname) |
2591 return Qnil; | 2591 return Qnil; |
2592 { | 2592 { |
2593 Lisp_Object val = build_istring (fname); | 2593 Lisp_Object val = build_istring (fname); |
2594 xfree (fname, Ibyte *); | 2594 xfree (fname); |
2595 return val; | 2595 return val; |
2596 } | 2596 } |
2597 } | 2597 } |
2598 return Qnil; | 2598 return Qnil; |
2599 #else | 2599 #else |