diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/emacs.c | 7 | ||||
| -rw-r--r-- | src/fileio.c | 29 | ||||
| -rw-r--r-- | src/lisp.h | 8 | ||||
| -rw-r--r-- | src/s/ms-w32.h | 3 | ||||
| -rw-r--r-- | src/w32proc.c | 10 |
6 files changed, 35 insertions, 43 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 728a442e86b..d938bd57fd7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,24 @@ | |||
| 1 | 2010-06-04 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | Turn `directory-sep-char' into a noop. | ||
| 4 | |||
| 5 | * lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare. | ||
| 6 | (DIRECTORY_SEP): Define unconditionally. | ||
| 7 | |||
| 8 | * s/ms-w32.h (DIRECTORY_SEP): Remove. | ||
| 9 | |||
| 10 | * emacs.c (decode_env_path): Don't check DIRECTORY_SEP, | ||
| 11 | call dostounix_filename directly. | ||
| 12 | |||
| 13 | * fileio.c (CORRECT_DIR_SEPS): Remove. | ||
| 14 | (Ffile_name_directory, directory_file_name, Fexpand_file_name) | ||
| 15 | (Fsubstitute_in_file_name): Use dostounix_filename instead. | ||
| 16 | (file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP. | ||
| 17 | (syms_of_fileio) <directory-sep-char>: Move to subr.el. | ||
| 18 | |||
| 19 | * w32proc.c (CORRECT_DIR_SEPS): Remove. | ||
| 20 | (Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename. | ||
| 21 | |||
| 1 | 2010-06-03 Dan Nicolaescu <dann@ics.uci.edu> | 22 | 2010-06-03 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 23 | ||
| 3 | Move UNEXEC definition to autoconf. | 24 | Move UNEXEC definition to autoconf. |
diff --git a/src/emacs.c b/src/emacs.c index c0ef926da75..7e778e2e5fd 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1723,7 +1723,7 @@ main (int argc, char **argv) | |||
| 1723 | #endif | 1723 | #endif |
| 1724 | init_window (); | 1724 | init_window (); |
| 1725 | init_font (); | 1725 | init_font (); |
| 1726 | 1726 | ||
| 1727 | if (!initialized) | 1727 | if (!initialized) |
| 1728 | { | 1728 | { |
| 1729 | char *file; | 1729 | char *file; |
| @@ -2384,10 +2384,7 @@ decode_env_path (evarname, defalt) | |||
| 2384 | strcpy (p, path); | 2384 | strcpy (p, path); |
| 2385 | path = p; | 2385 | path = p; |
| 2386 | 2386 | ||
| 2387 | if ('/' == DIRECTORY_SEP) | 2387 | dostounix_filename (path); |
| 2388 | dostounix_filename (path); | ||
| 2389 | else | ||
| 2390 | unixtodos_filename (path); | ||
| 2391 | } | 2388 | } |
| 2392 | #endif | 2389 | #endif |
| 2393 | lpath = Qnil; | 2390 | lpath = Qnil; |
diff --git a/src/fileio.c b/src/fileio.c index dc5ca37ff2f..8c2ee45c073 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -83,10 +83,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 83 | #endif | 83 | #endif |
| 84 | 84 | ||
| 85 | #ifdef DOS_NT | 85 | #ifdef DOS_NT |
| 86 | #define CORRECT_DIR_SEPS(s) \ | ||
| 87 | do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ | ||
| 88 | else unixtodos_filename (s); \ | ||
| 89 | } while (0) | ||
| 90 | /* On Windows, drive letters must be alphabetic - on DOS, the Netware | 86 | /* On Windows, drive letters must be alphabetic - on DOS, the Netware |
| 91 | redirector allows the six letters between 'Z' and 'a' as well. */ | 87 | redirector allows the six letters between 'Z' and 'a' as well. */ |
| 92 | #ifdef MSDOS | 88 | #ifdef MSDOS |
| @@ -474,7 +470,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) | |||
| 474 | p = beg + strlen (beg); | 470 | p = beg + strlen (beg); |
| 475 | } | 471 | } |
| 476 | } | 472 | } |
| 477 | CORRECT_DIR_SEPS (beg); | 473 | dostounix_filename (beg); |
| 478 | #endif /* DOS_NT */ | 474 | #endif /* DOS_NT */ |
| 479 | 475 | ||
| 480 | return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename)); | 476 | return make_specified_string (beg, -1, p - beg, STRING_MULTIBYTE (filename)); |
| @@ -561,12 +557,11 @@ file_name_as_directory (out, in) | |||
| 561 | /* For Unix syntax, Append a slash if necessary */ | 557 | /* For Unix syntax, Append a slash if necessary */ |
| 562 | if (!IS_DIRECTORY_SEP (out[size])) | 558 | if (!IS_DIRECTORY_SEP (out[size])) |
| 563 | { | 559 | { |
| 564 | /* Cannot use DIRECTORY_SEP, which could have any value */ | 560 | out[size + 1] = DIRECTORY_SEP; |
| 565 | out[size + 1] = '/'; | ||
| 566 | out[size + 2] = '\0'; | 561 | out[size + 2] = '\0'; |
| 567 | } | 562 | } |
| 568 | #ifdef DOS_NT | 563 | #ifdef DOS_NT |
| 569 | CORRECT_DIR_SEPS (out); | 564 | dostounix_filename (out); |
| 570 | #endif | 565 | #endif |
| 571 | return out; | 566 | return out; |
| 572 | } | 567 | } |
| @@ -627,7 +622,7 @@ directory_file_name (src, dst) | |||
| 627 | ) | 622 | ) |
| 628 | dst[slen - 1] = 0; | 623 | dst[slen - 1] = 0; |
| 629 | #ifdef DOS_NT | 624 | #ifdef DOS_NT |
| 630 | CORRECT_DIR_SEPS (dst); | 625 | dostounix_filename (dst); |
| 631 | #endif | 626 | #endif |
| 632 | return 1; | 627 | return 1; |
| 633 | } | 628 | } |
| @@ -1032,10 +1027,9 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1032 | if (!lose) | 1027 | if (!lose) |
| 1033 | { | 1028 | { |
| 1034 | #ifdef DOS_NT | 1029 | #ifdef DOS_NT |
| 1035 | /* Make sure directories are all separated with / or \ as | 1030 | /* Make sure directories are all separated with /, but |
| 1036 | desired, but avoid allocation of a new string when not | 1031 | avoid allocation of a new string when not required. */ |
| 1037 | required. */ | 1032 | dostounix_filename (nm); |
| 1038 | CORRECT_DIR_SEPS (nm); | ||
| 1039 | #ifdef WINDOWSNT | 1033 | #ifdef WINDOWSNT |
| 1040 | if (IS_DIRECTORY_SEP (nm[1])) | 1034 | if (IS_DIRECTORY_SEP (nm[1])) |
| 1041 | { | 1035 | { |
| @@ -1381,7 +1375,7 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1381 | target[0] = '/'; | 1375 | target[0] = '/'; |
| 1382 | target[1] = ':'; | 1376 | target[1] = ':'; |
| 1383 | } | 1377 | } |
| 1384 | CORRECT_DIR_SEPS (target); | 1378 | dostounix_filename (target); |
| 1385 | #endif /* DOS_NT */ | 1379 | #endif /* DOS_NT */ |
| 1386 | 1380 | ||
| 1387 | result = make_specified_string (target, -1, o - target, multibyte); | 1381 | result = make_specified_string (target, -1, o - target, multibyte); |
| @@ -1659,7 +1653,7 @@ those `/' is discarded. */) | |||
| 1659 | bcopy (SDATA (filename), nm, SBYTES (filename) + 1); | 1653 | bcopy (SDATA (filename), nm, SBYTES (filename) + 1); |
| 1660 | 1654 | ||
| 1661 | #ifdef DOS_NT | 1655 | #ifdef DOS_NT |
| 1662 | CORRECT_DIR_SEPS (nm); | 1656 | dostounix_filename (nm); |
| 1663 | substituted = (strcmp (nm, SDATA (filename)) != 0); | 1657 | substituted = (strcmp (nm, SDATA (filename)) != 0); |
| 1664 | #endif | 1658 | #endif |
| 1665 | endp = nm + SBYTES (filename); | 1659 | endp = nm + SBYTES (filename); |
| @@ -5787,11 +5781,6 @@ of file names regardless of the current language environment. */); | |||
| 5787 | Fput (Qfile_date_error, Qerror_message, | 5781 | Fput (Qfile_date_error, Qerror_message, |
| 5788 | make_pure_c_string ("Cannot set file date")); | 5782 | make_pure_c_string ("Cannot set file date")); |
| 5789 | 5783 | ||
| 5790 | DEFVAR_LISP ("directory-sep-char", &Vdirectory_sep_char, | ||
| 5791 | doc: /* Directory separator character for built-in functions that return file names. | ||
| 5792 | The value is always ?/. Don't use this variable, just use `/'. */); | ||
| 5793 | XSETFASTINT (Vdirectory_sep_char, '/'); | ||
| 5794 | |||
| 5795 | DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist, | 5784 | DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist, |
| 5796 | doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially. | 5785 | doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially. |
| 5797 | If a file name matches REGEXP, then all I/O on that file is done by calling | 5786 | If a file name matches REGEXP, then all I/O on that file is done by calling |
diff --git a/src/lisp.h b/src/lisp.h index e17931ca366..7c6c85e6356 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3509,16 +3509,10 @@ extern char *egetenv P_ ((char *)); | |||
| 3509 | extern void init_system_name P_ ((void)); | 3509 | extern void init_system_name P_ ((void)); |
| 3510 | 3510 | ||
| 3511 | /* Some systems (e.g., NT) use a different path separator than Unix, | 3511 | /* Some systems (e.g., NT) use a different path separator than Unix, |
| 3512 | in addition to a device separator. Default the path separator | 3512 | in addition to a device separator. Set the path separator |
| 3513 | to '/', and don't test for a device separator in IS_ANY_SEP. */ | 3513 | to '/', and don't test for a device separator in IS_ANY_SEP. */ |
| 3514 | 3514 | ||
| 3515 | #ifdef WINDOWSNT | ||
| 3516 | extern Lisp_Object Vdirectory_sep_char; | ||
| 3517 | #endif | ||
| 3518 | |||
| 3519 | #ifndef DIRECTORY_SEP | ||
| 3520 | #define DIRECTORY_SEP '/' | 3515 | #define DIRECTORY_SEP '/' |
| 3521 | #endif | ||
| 3522 | #ifndef IS_DIRECTORY_SEP | 3516 | #ifndef IS_DIRECTORY_SEP |
| 3523 | #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) | 3517 | #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) |
| 3524 | #endif | 3518 | #endif |
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 2d6cc2f4bd5..1fcf73d2578 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h | |||
| @@ -95,9 +95,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 95 | your system and must be used only through an encapsulation (which | 95 | your system and must be used only through an encapsulation (which |
| 96 | you should place, by convention, in sysdep.c). */ | 96 | you should place, by convention, in sysdep.c). */ |
| 97 | 97 | ||
| 98 | /* Define this to be the separator between path elements. */ | ||
| 99 | #define DIRECTORY_SEP XINT (Vdirectory_sep_char) | ||
| 100 | |||
| 101 | /* Define this to be the separator between devices and paths. */ | 98 | /* Define this to be the separator between devices and paths. */ |
| 102 | #define DEVICE_SEP ':' | 99 | #define DEVICE_SEP ':' |
| 103 | 100 | ||
diff --git a/src/w32proc.c b/src/w32proc.c index 9d4d58f1230..b8443e5a75b 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1762,12 +1762,6 @@ socket connections still exist. */) | |||
| 1762 | /* Some miscellaneous functions that are Windows specific, but not GUI | 1762 | /* Some miscellaneous functions that are Windows specific, but not GUI |
| 1763 | specific (ie. are applicable in terminal or batch mode as well). */ | 1763 | specific (ie. are applicable in terminal or batch mode as well). */ |
| 1764 | 1764 | ||
| 1765 | /* lifted from fileio.c */ | ||
| 1766 | #define CORRECT_DIR_SEPS(s) \ | ||
| 1767 | do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \ | ||
| 1768 | else unixtodos_filename (s); \ | ||
| 1769 | } while (0) | ||
| 1770 | |||
| 1771 | DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1, 0, | 1765 | DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1, 0, |
| 1772 | doc: /* Return the short file name version (8.3) of the full path of FILENAME. | 1766 | doc: /* Return the short file name version (8.3) of the full path of FILENAME. |
| 1773 | If FILENAME does not exist, return nil. | 1767 | If FILENAME does not exist, return nil. |
| @@ -1786,7 +1780,7 @@ All path elements in FILENAME are converted to their short names. */) | |||
| 1786 | if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0) | 1780 | if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0) |
| 1787 | return Qnil; | 1781 | return Qnil; |
| 1788 | 1782 | ||
| 1789 | CORRECT_DIR_SEPS (shortname); | 1783 | dostounix_filename (shortname); |
| 1790 | 1784 | ||
| 1791 | return build_string (shortname); | 1785 | return build_string (shortname); |
| 1792 | } | 1786 | } |
| @@ -1815,7 +1809,7 @@ All path elements in FILENAME are converted to their long names. */) | |||
| 1815 | if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH)) | 1809 | if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH)) |
| 1816 | return Qnil; | 1810 | return Qnil; |
| 1817 | 1811 | ||
| 1818 | CORRECT_DIR_SEPS (longname); | 1812 | dostounix_filename (longname); |
| 1819 | 1813 | ||
| 1820 | /* If we were passed only a drive, make sure that a slash is not appended | 1814 | /* If we were passed only a drive, make sure that a slash is not appended |
| 1821 | for consistency with directories. Allow for drive mapping via SUBST | 1815 | for consistency with directories. Allow for drive mapping via SUBST |