From 0a7a6051a9c0b50cd59285e9d174d3362e913ebd Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 26 Nov 2007 23:04:09 +0000 Subject: [PATCH] (sys_spawnve): Quote args with wildcards. --- src/ChangeLog | 4 ++++ src/w32proc.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9ed11c061e2..13edfa07e90 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-11-26 Jason Rumney + + * w32proc.c (sys_spawnve): Quote args with wildcards. + 2007-11-26 Andreas Schwab * process.c (list_processes_1): Fix indentation level of the diff --git a/src/w32proc.c b/src/w32proc.c index c21d589c525..a14a8ee384c 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -781,7 +781,14 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) variable in their environment. */ char ppid_env_var_buffer[64]; char *extra_env[] = {ppid_env_var_buffer, NULL}; - char *sepchars = " \t"; + /* These are the characters that cause an argument to need quoting. + Arguments with whitespace characters need quoting to prevent the + argument being split into two or more. Arguments with wildcards + are also quoted, for consistency with posix platforms, where wildcards + are not expanded if we run the program directly without a shell. + Some extra whitespace characters need quoting in Cygwin programs, + so this list is conditionally modified below. */ + char *sepchars = " \t*?"; /* We don't care about the other modes */ if (mode != _P_NOWAIT) -- 2.39.2