]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't modify the process's command name passed to start-process on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Wed, 1 Oct 2014 15:18:16 +0000 (18:18 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 1 Oct 2014 15:18:16 +0000 (18:18 +0300)
 src/w32proc.c (sys_spawnve): Avoid modification of the CMDNAME
 argument passed by the caller, when we mirror all slashes into
 backslashes.

src/ChangeLog
src/w32proc.c

index de462841e0dd62bc47443787be068b6a2fe63a8a..1effdb3a3b201cae8a94b866b104fa3860ac87e8 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32proc.c (sys_spawnve): Avoid modification of the CMDNAME
+       argument passed by the caller, when we mirror all slashes into
+       backslashes.
+
 2014-10-01  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * gtkutil.c (xg_set_toolkit_horizontal_scroll_bar_thumb):
index b255c57cd7c2c8d8faf1dd8ce18acd319b4f3f59..38452917addb9a301d15dce1be2035afb6169b6c 100644 (file)
@@ -1605,6 +1605,15 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp)
       program = ENCODE_FILE (full);
       cmdname = SDATA (program);
     }
+  else
+    {
+      char *p = alloca (strlen (cmdname) + 1);
+
+      /* Don't change the command name we were passed by our caller
+        (unixtodos_filename below will destructively mirror forward
+        slashes).  */
+      cmdname = strcpy (p, cmdname);
+    }
 
   /* make sure argv[0] and cmdname are both in DOS format */
   unixtodos_filename (cmdname);