Bug#43005 main.init_connect fails on Windows due to wrong quoting of args
- The arguments are properly quoted when mtr.pl calls my_safe_process but unfortunately the all off when running with active state perl and stays in cygwin perl. - Extend the patch to only quote args that are not already quoted This a redo of previous commit, will be included in next push
This commit is contained in:
parent
ed64190b23
commit
9ff20f55bd
@ -186,14 +186,20 @@ int main(int argc, const char** argv )
|
|||||||
die("No real args -> nothing to do");
|
die("No real args -> nothing to do");
|
||||||
/* Copy the remaining args to child_arg */
|
/* Copy the remaining args to child_arg */
|
||||||
for (int j= i+1; j < argc; j++) {
|
for (int j= i+1; j < argc; j++) {
|
||||||
if (strchr (argv[j], ' ')) {
|
arg= argv[j];
|
||||||
/* Protect with "" if this arg contains a space */
|
if (strchr (arg, ' ') &&
|
||||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
arg[0] != '\"' &&
|
||||||
"\"%s\" ", argv[j]);
|
arg[strlen(arg)] != '\"')
|
||||||
} else {
|
{
|
||||||
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
/* Quote arg that contains spaces and are not quoted already */
|
||||||
"%s ", argv[j]);
|
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||||
}
|
"\"%s\" ", arg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
to+= _snprintf(to, child_args + sizeof(child_args) - to,
|
||||||
|
"%s ", arg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user