diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2008-11-29 18:35:33 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2008-11-29 18:35:33 +0000 |
commit | b23077df66f0b60e9ca9b0435f32326eadad9161 (patch) | |
tree | aa6dbfdbf54069cccdef00d0227d8c6404a67093 /src/w32proc.c | |
parent | d182658510e5c8b91c49cb755aee4d94e5cb89f9 (diff) | |
download | emacs-b23077df66f0b60e9ca9b0435f32326eadad9161.tar.gz |
* w32proc.c: Include "coding.h".
(Fw32_short_file_name): Encode filename passed to Windows API.
(Fw32_long_file_name): Encode filename passed to Windows API and
decode back the result. (Bug#1433)
Diffstat (limited to 'src/w32proc.c')
-rw-r--r-- | src/w32proc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index ed405cce9ff..081749257f5 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -63,6 +63,7 @@ extern BOOL WINAPI IsValidLocale(LCID, DWORD); #include "syssignal.h" #include "w32term.h" #include "dispextern.h" /* for xstrcasecmp */ +#include "coding.h" #define RVA_TO_PTR(var,section,filedata) \ ((void *)((section)->PointerToRawData \ @@ -1781,7 +1782,7 @@ All path elements in FILENAME are converted to their short names. */) filename = Fexpand_file_name (filename, Qnil); /* luckily, this returns the short version of each element in the path. */ - if (GetShortPathName (SDATA (filename), shortname, MAX_PATH) == 0) + if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0) return Qnil; CORRECT_DIR_SEPS (shortname); @@ -1810,7 +1811,7 @@ All path elements in FILENAME are converted to their long names. */) /* first expand it. */ filename = Fexpand_file_name (filename, Qnil); - if (!w32_get_long_filename (SDATA (filename), longname, MAX_PATH)) + if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH)) return Qnil; CORRECT_DIR_SEPS (longname); @@ -1821,7 +1822,7 @@ All path elements in FILENAME are converted to their long names. */) if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3]) longname[2] = '\0'; - return build_string (longname); + return DECODE_FILE (build_string (longname)); } DEFUN ("w32-set-process-priority", Fw32_set_process_priority, |