comparison src/w32proc.c @ 108888:c2ac5cece5ea

Turn `directory-sep-char' into a noop. * lisp/subr.el (directory-sep-char): Move from fileio.c and make a defconst. * src/emacs.c (decode_env_path): Don't check DIRECTORY_SEP, call dostounix_filename directly. * src/fileio.c (CORRECT_DIR_SEPS): Remove. (Ffile_name_directory, directory_file_name, Fexpand_file_name) (Fsubstitute_in_file_name): Use dostounix_filename instead. (file_name_as_directory): Use dostounix_filename, DIRECTORY_SEP. (syms_of_fileio) <directory-sep-char>: Move to subr.el. * src/lisp.h [WINDOWSNT] (Vdirectory_sep_char): Don't declare. (DIRECTORY_SEP): Define unconditionally. * src/w32proc.c (CORRECT_DIR_SEPS): Remove. (Fw32_short_file_name, Fw32_long_file_name): Use dostounix_filename. * src/s/ms-w32.h (DIRECTORY_SEP): Remove.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 04 Jun 2010 16:13:35 +0200
parents 1d1d5d9bd884
children e27859da5624
comparison
equal deleted inserted replaced
108887:2c20a51413cb 108888:c2ac5cece5ea
1760 1760
1761 1761
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.
1774 All path elements in FILENAME are converted to their short names. */) 1768 All path elements in FILENAME are converted to their short names. */)
1775 (filename) 1769 (filename)
1784 1778
1785 /* luckily, this returns the short version of each element in the path. */ 1779 /* luckily, this returns the short version of each element in the path. */
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 }
1793 1787
1794 1788
1813 filename = Fexpand_file_name (filename, Qnil); 1807 filename = Fexpand_file_name (filename, Qnil);
1814 1808
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
1822 in case expand-file-name is ever changed to expand those. */ 1816 in case expand-file-name is ever changed to expand those. */
1823 if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3]) 1817 if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3])