diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-08-23 18:01:35 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-08-23 18:01:35 +0300 |
commit | 877e77e3ee5da0926b7528d602addeec51709da0 (patch) | |
tree | 83d52b917d14cda4995fea5318b0c8b32ebde522 | |
parent | 6b1765e05db432007ede6f1af3744e71063a728b (diff) | |
download | emacs-877e77e3ee5da0926b7528d602addeec51709da0.tar.gz |
Support exec-directory with non-ASCII characters on Windows
* src/w32proc.c (sys_spawnve): Make sure exec-directory is encoded
in the system's ANSI codepage, when it is used for invoking
cmdproxy.
-rw-r--r-- | src/w32proc.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index d861edeb78b..3aa80302b95 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1813,13 +1813,21 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) cmdname = alloca (MAX_PATH); if (egetenv ("CMDPROXY")) - strcpy (cmdname, egetenv ("CMDPROXY")); + { + /* Implementation note: since process-environment, where + 'egetenv' looks, is encoded in the system codepage, we + don't need to encode the cmdproxy file name if we get it + from the environment. */ + strcpy (cmdname, egetenv ("CMDPROXY")); + } else { - char *q = lispstpcpy (cmdname, Vexec_directory); + char *q = lispstpcpy (cmdname, + /* exec-directory needs to be encoded. */ + ansi_encode_filename (Vexec_directory)); /* If we are run from the source tree, use cmdproxy.exe from the same source tree. */ - for (p = q - 2; p > cmdname; p--) + for (p = q - 2; p > cmdname; p = CharPrevA (cmdname, p)) if (*p == '/') break; if (*p == '/' && xstrcasecmp (p, "/lib-src/") == 0) |