Revision: 18501
          http://sourceforge.net/p/edk2/code/18501
Author:   hwu1225
Date:     2015-09-18 01:18:34 +0000 (Fri, 18 Sep 2015)
Log Message:
-----------
ShellPkg: Fix Shell fail when execute command in ShellProtocol.Execute().

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.

(Sync patch r18491 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yang Jadis <[email protected]>
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18491

Modified Paths:
--------------
    branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c

Modified: branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c
===================================================================
--- branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c       
2015-09-18 01:08:31 UTC (rev 18500)
+++ branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c       
2015-09-18 01:18:34 UTC (rev 18501)
@@ -206,6 +206,7 @@
     return (EFI_SUCCESS);
   }
 
+  TrimSpaces(&(CHAR16*)CommandLine);
   Size = StrSize(CommandLine);
   TempParameter = AllocateZeroPool(Size);
   if (TempParameter == NULL) {
@@ -359,7 +360,6 @@
     //
     // Populate Argc and Argv
     //
-    TrimSpaces (&FullCommandLine);
     Status = ParseCommandLineToArgs(FullCommandLine,
                                     &(*NewShellParameters)->Argv,
                                     &(*NewShellParameters)->Argc);


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to