emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master b0fe29e: Fix invocation of programs via cmdproxy.ex


From: Eli Zaretskii
Subject: [Emacs-diffs] master b0fe29e: Fix invocation of programs via cmdproxy.exe
Date: Sat, 22 Aug 2015 19:16:27 +0000

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

    Fix invocation of programs via cmdproxy.exe
    
    * src/w32proc.c (sys_spawnve): Use exec-directory, not
    invocation-directory, for finding cmdproxy.exe.  When Emacs is
    run from the source tree, look for cmdproxy.exe in the same source
    tree.  (Bug#21323)
---
 src/w32proc.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/w32proc.c b/src/w32proc.c
index 66a9761..d861ede 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1815,7 +1815,17 @@ sys_spawnve (int mode, char *cmdname, char **argv, char 
**envp)
       if (egetenv ("CMDPROXY"))
        strcpy (cmdname, egetenv ("CMDPROXY"));
       else
-       strcpy (lispstpcpy (cmdname, Vinvocation_directory), "cmdproxy.exe");
+       {
+         char *q = lispstpcpy (cmdname, 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--)
+           if (*p == '/')
+             break;
+         if (*p == '/' && xstrcasecmp (p, "/lib-src/") == 0)
+           q = stpcpy (p, "/nt/");
+         strcpy (q, "cmdproxy.exe");
+       }
 
       /* Can't use unixtodos_filename here, since that needs its file
         name argument encoded in UTF-8.  */



reply via email to

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