diff options
Diffstat (limited to 'src/w32proc.c')
| -rw-r--r-- | src/w32proc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index 33981445c7c..ed405cce9ff 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1799,9 +1799,14 @@ All path elements in FILENAME are converted to their long names. */) | |||
| 1799 | Lisp_Object filename; | 1799 | Lisp_Object filename; |
| 1800 | { | 1800 | { |
| 1801 | char longname[ MAX_PATH ]; | 1801 | char longname[ MAX_PATH ]; |
| 1802 | int drive_only = 0; | ||
| 1802 | 1803 | ||
| 1803 | CHECK_STRING (filename); | 1804 | CHECK_STRING (filename); |
| 1804 | 1805 | ||
| 1806 | if (SBYTES (filename) == 2 | ||
| 1807 | && *(SDATA (filename) + 1) == ':') | ||
| 1808 | drive_only = 1; | ||
| 1809 | |||
| 1805 | /* first expand it. */ | 1810 | /* first expand it. */ |
| 1806 | filename = Fexpand_file_name (filename, Qnil); | 1811 | filename = Fexpand_file_name (filename, Qnil); |
| 1807 | 1812 | ||
| @@ -1810,6 +1815,12 @@ All path elements in FILENAME are converted to their long names. */) | |||
| 1810 | 1815 | ||
| 1811 | CORRECT_DIR_SEPS (longname); | 1816 | CORRECT_DIR_SEPS (longname); |
| 1812 | 1817 | ||
| 1818 | /* If we were passed only a drive, make sure that a slash is not appended | ||
| 1819 | for consistency with directories. Allow for drive mapping via SUBST | ||
| 1820 | in case expand-file-name is ever changed to expand those. */ | ||
| 1821 | if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3]) | ||
| 1822 | longname[2] = '\0'; | ||
| 1823 | |||
| 1813 | return build_string (longname); | 1824 | return build_string (longname); |
| 1814 | } | 1825 | } |
| 1815 | 1826 | ||