]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Fix Shell fail when execute command in ShellProtocol.Execute().
authorYang Jadis <jadis.yang@intel.com>
Thu, 17 Sep 2015 01:42:59 +0000 (01:42 +0000)
committershenshushi <shenshushi@Edk2>
Thu, 17 Sep 2015 01:42:59 +0000 (01:42 +0000)
When execute a command with tailing blank spaces in ShellProtocol.Execute() Shell will fail.
This patch move the TrimSpaces operation into ParseCommandLineToArgs function to fix the problem.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yang Jadis <jadis.yang@intel.com>
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18491 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Application/Shell/ShellParametersProtocol.c

index bc19df7e931e7d556a684671f5f1a8863a8ecf62..b4049873404466e22b098c975c214abd06deb6ae 100644 (file)
@@ -206,6 +206,7 @@ ParseCommandLineToArgs(
     return (EFI_SUCCESS);\r
   }\r
 \r
+  TrimSpaces(&(CHAR16*)CommandLine);\r
   Size = StrSize(CommandLine);\r
   TempParameter = AllocateZeroPool(Size);\r
   if (TempParameter == NULL) {\r
@@ -359,7 +360,6 @@ CreatePopulateInstallShellParametersProtocol (
     //\r
     // Populate Argc and Argv\r
     //\r
-    TrimSpaces (&FullCommandLine);\r
     Status = ParseCommandLineToArgs(FullCommandLine,\r
                                     &(*NewShellParameters)->Argv,\r
                                     &(*NewShellParameters)->Argc);\r