diff options
| author | Eli Zaretskii | 2013-12-09 21:18:58 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-12-09 21:18:58 +0200 |
| commit | afec5165194e5d44c0af4f6f20e26e29aab79cdf (patch) | |
| tree | 143a5dc7e6e3e65439b46f6d8767da525bca4e4c /src | |
| parent | 245ddcaa82a7778f662f28584eab8be48c7cfede (diff) | |
| download | emacs-afec5165194e5d44c0af4f6f20e26e29aab79cdf.tar.gz emacs-afec5165194e5d44c0af4f6f20e26e29aab79cdf.zip | |
Fixed file-truename when w32-unicode-filenames is nil, fixed its doc.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 18 | ||||
| -rw-r--r-- | src/w32term.c | 4 |
2 files changed, 17 insertions, 5 deletions
| @@ -2123,7 +2123,7 @@ parse_root (const char * name, const char ** pPath) | |||
| 2123 | static int | 2123 | static int |
| 2124 | get_long_basename (char * name, char * buf, int size) | 2124 | get_long_basename (char * name, char * buf, int size) |
| 2125 | { | 2125 | { |
| 2126 | HANDLE dir_handle; | 2126 | HANDLE dir_handle = INVALID_HANDLE_VALUE; |
| 2127 | char fname_utf8[MAX_UTF8_PATH]; | 2127 | char fname_utf8[MAX_UTF8_PATH]; |
| 2128 | int len = 0; | 2128 | int len = 0; |
| 2129 | int cstatus = -1; | 2129 | int cstatus = -1; |
| @@ -2148,9 +2148,19 @@ get_long_basename (char * name, char * buf, int size) | |||
| 2148 | WIN32_FIND_DATAA find_data_ansi; | 2148 | WIN32_FIND_DATAA find_data_ansi; |
| 2149 | 2149 | ||
| 2150 | filename_to_ansi (name, fname_ansi); | 2150 | filename_to_ansi (name, fname_ansi); |
| 2151 | dir_handle = FindFirstFileA (fname_ansi, &find_data_ansi); | 2151 | /* If the ANSI name includes ? characters, it is not encodable |
| 2152 | if (dir_handle != INVALID_HANDLE_VALUE) | 2152 | in the ANSI codepage. In that case, we deliver the question |
| 2153 | cstatus = filename_from_ansi (find_data_ansi.cFileName, fname_utf8); | 2153 | marks to the caller; calling FindFirstFileA in this case |
| 2154 | could return some unrelated file name in the same | ||
| 2155 | directory. */ | ||
| 2156 | if (_mbspbrk (fname_ansi, "?")) | ||
| 2157 | cstatus = filename_from_ansi (fname_ansi, fname_utf8); | ||
| 2158 | else | ||
| 2159 | { | ||
| 2160 | dir_handle = FindFirstFileA (fname_ansi, &find_data_ansi); | ||
| 2161 | if (dir_handle != INVALID_HANDLE_VALUE) | ||
| 2162 | cstatus = filename_from_ansi (find_data_ansi.cFileName, fname_utf8); | ||
| 2163 | } | ||
| 2154 | } | 2164 | } |
| 2155 | 2165 | ||
| 2156 | if (cstatus == 0 && (len = strlen (fname_utf8)) < size) | 2166 | if (cstatus == 0 && (len = strlen (fname_utf8)) < size) |
diff --git a/src/w32term.c b/src/w32term.c index 64febea6a1a..2b91aa99dc2 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -6674,7 +6674,9 @@ specified by `file-name-coding-system'. | |||
| 6674 | 6674 | ||
| 6675 | This variable is set to non-nil by default when Emacs runs on Windows | 6675 | This variable is set to non-nil by default when Emacs runs on Windows |
| 6676 | systems of the NT family, including W2K, XP, Vista, Windows 7 and | 6676 | systems of the NT family, including W2K, XP, Vista, Windows 7 and |
| 6677 | Windows 8. It is set to nil on Windows 9X. */); | 6677 | Windows 8. It is set to nil on Windows 9X. |
| 6678 | |||
| 6679 | Do NOT change the value of this variable, except for debugging purposes! */); | ||
| 6678 | w32_unicode_filenames = 0; | 6680 | w32_unicode_filenames = 0; |
| 6679 | 6681 | ||
| 6680 | /* Tell Emacs about this window system. */ | 6682 | /* Tell Emacs about this window system. */ |