mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:12:56 +00:00
dont use the whole commandline as a fall back for execution searching because it could contain spaces. also, wrap commandline params in quotes so if there is a space in the path it still finds it. bug found by billgMS.
svn path=/trunk/; revision=18250
This commit is contained in:
parent
7402ea80eb
commit
ce7daa3fef
1 changed files with 3 additions and 5 deletions
|
@ -422,8 +422,6 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||||
/* get the PATH environment variable and parse it */
|
/* get the PATH environment variable and parse it */
|
||||||
/* search the PATH environment variable for the binary */
|
/* search the PATH environment variable for the binary */
|
||||||
if (!SearchForExecutable (first, szFullName))
|
if (!SearchForExecutable (first, szFullName))
|
||||||
{
|
|
||||||
if (!SearchForExecutable (full, szFullName))
|
|
||||||
{
|
{
|
||||||
error_bad_command ();
|
error_bad_command ();
|
||||||
free (first);
|
free (first);
|
||||||
|
@ -431,7 +429,6 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
||||||
free (full);
|
free (full);
|
||||||
free (szFullName);
|
free (szFullName);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1619,13 +1616,14 @@ Initialize (int argc, TCHAR* argv[])
|
||||||
++i;
|
++i;
|
||||||
if (i < argc)
|
if (i < argc)
|
||||||
{
|
{
|
||||||
_tcscpy (commandline, argv[i]);
|
_tcscpy (commandline, _T("\""));
|
||||||
|
_tcscat (commandline, argv[i]);
|
||||||
|
_tcscat (commandline, _T("\""));
|
||||||
while (++i < argc)
|
while (++i < argc)
|
||||||
{
|
{
|
||||||
_tcscat (commandline, _T(" "));
|
_tcscat (commandline, _T(" "));
|
||||||
_tcscat (commandline, argv[i]);
|
_tcscat (commandline, argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseCommandLine(commandline);
|
ParseCommandLine(commandline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue