From ce7daa3fefa77bfde5679d3fcde709b0b37e6380 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Mon, 3 Oct 2005 20:28:29 +0000 Subject: [PATCH] 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 --- reactos/subsys/system/cmd/cmd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reactos/subsys/system/cmd/cmd.c b/reactos/subsys/system/cmd/cmd.c index 9927f1cd3cd..0579e3d701e 100644 --- a/reactos/subsys/system/cmd/cmd.c +++ b/reactos/subsys/system/cmd/cmd.c @@ -423,15 +423,12 @@ Execute (LPTSTR Full, LPTSTR First, LPTSTR Rest) /* search the PATH environment variable for the binary */ if (!SearchForExecutable (first, szFullName)) { - if (!SearchForExecutable (full, szFullName)) - { error_bad_command (); free (first); free (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); } }