From: Eli Zaretskii Date: Wed, 1 Oct 2014 15:18:16 +0000 (+0300) Subject: Don't modify the process's command name passed to start-process on MS-Windows. X-Git-Tag: emacs-25.0.90~2635^2~679^2~173 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f94ec2f3c82123e284c412ca8841c57491924f85;p=emacs.git Don't modify the process's command name passed to start-process on MS-Windows. src/w32proc.c (sys_spawnve): Avoid modification of the CMDNAME argument passed by the caller, when we mirror all slashes into backslashes. --- diff --git a/src/ChangeLog b/src/ChangeLog index de462841e0d..1effdb3a3b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-10-01 Eli Zaretskii + + * 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 * gtkutil.c (xg_set_toolkit_horizontal_scroll_bar_thumb): diff --git a/src/w32proc.c b/src/w32proc.c index b255c57cd7c..38452917add 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -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);