emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 877e77e: Support exec-directory with non-ASCII char


From: Eli Zaretskii
Subject: [Emacs-diffs] master 877e77e: Support exec-directory with non-ASCII characters on Windows
Date: Sun, 23 Aug 2015 15:02:46 +0000

branch: master
commit 877e77e3ee5da0926b7528d602addeec51709da0
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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.
---
 src/w32proc.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/w32proc.c b/src/w32proc.c
index d861ede..3aa8030 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]