mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
merge 43005
This commit is contained in:
commit
a1c9405354
1 changed files with 14 additions and 8 deletions
|
@ -186,14 +186,20 @@ int main(int argc, const char** argv )
|
|||
die("No real args -> nothing to do");
|
||||
/* Copy the remaining args to child_arg */
|
||||
for (int j= i+1; j < argc; j++) {
|
||||
if (strchr (argv[j], ' ')) {
|
||||
/* Protect with "" if this arg contains a space */
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||
"\"%s\" ", argv[j]);
|
||||
} else {
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||
"%s ", argv[j]);
|
||||
}
|
||||
arg= argv[j];
|
||||
if (strchr (arg, ' ') &&
|
||||
arg[0] != '\"' &&
|
||||
arg[strlen(arg)] != '\"')
|
||||
{
|
||||
/* Quote arg that contains spaces and are not quoted already */
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||
"\"%s\" ", arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||
"%s ", arg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue