mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 08:53:02 +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 */
|
||||
/* search the PATH environment variable for the binary */
|
||||
if (!SearchForExecutable (first, szFullName))
|
||||
{
|
||||
if (!SearchForExecutable (full, szFullName))
|
||||
{
|
||||
error_bad_command ();
|
||||
free (first);
|
||||
|
@ -431,7 +429,6 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest)
|
|||
free (full);
|
||||
free (szFullName);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1619,13 +1616,14 @@ Initialize (int argc, TCHAR* argv[])
|
|||
++i;
|
||||
if (i < argc)
|
||||
{
|
||||
_tcscpy (commandline, argv[i]);
|
||||
_tcscpy (commandline, _T("\""));
|
||||
_tcscat (commandline, argv[i]);
|
||||
_tcscat (commandline, _T("\""));
|
||||
while (++i < argc)
|
||||
{
|
||||
_tcscat (commandline, _T(" "));
|
||||
_tcscat (commandline, argv[i]);
|
||||
}
|
||||
|
||||
ParseCommandLine(commandline);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue