Revision: 18433
          http://sourceforge.net/p/edk2/code/18433
Author:   hwu1225
Date:     2015-09-10 05:25:06 +0000 (Thu, 10 Sep 2015)
Log Message:
-----------
ShellPkg: Fix Shell fail with redundant space following delay number.

When boot from Shell we can use '-delay [num]' as optional data. If blank space 
exist after '[num]' Shell will fail. This patch add error handling to avoid 
this failure.

(Sync patch r18431 from main trunk.)

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

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

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

Modified: branches/UDK2015/ShellPkg/Application/Shell/Shell.h
===================================================================
--- branches/UDK2015/ShellPkg/Application/Shell/Shell.h 2015-09-10 05:24:32 UTC 
(rev 18432)
+++ branches/UDK2015/ShellPkg/Application/Shell/Shell.h 2015-09-10 05:25:06 UTC 
(rev 18433)
@@ -360,5 +360,16 @@
   IN CONST CHAR16 EscapeCharacter
   );
 
+/**
+  Cleans off leading and trailing spaces and tabs.
+
+  @param[in] String pointer to the string to trim them off.
+**/
+EFI_STATUS
+EFIAPI
+TrimSpaces(
+  IN CHAR16 **String
+  );
+
 #endif //_SHELL_INTERNAL_HEADER_
 

Modified: branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c
===================================================================
--- branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c       
2015-09-10 05:24:32 UTC (rev 18432)
+++ branches/UDK2015/ShellPkg/Application/Shell/ShellParametersProtocol.c       
2015-09-10 05:25:06 UTC (rev 18433)
@@ -359,6 +359,7 @@
     //
     // Populate Argc and Argv
     //
+    TrimSpaces (&FullCommandLine);
     Status = ParseCommandLineToArgs(FullCommandLine,
                                     &(*NewShellParameters)->Argv,
                                     &(*NewShellParameters)->Argc);


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to