Revision: 18431
http://sourceforge.net/p/edk2/code/18431
Author: shenshushi
Date: 2015-09-10 03:08:56 +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.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>
Modified Paths:
--------------
trunk/edk2/ShellPkg/Application/Shell/Shell.h
trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c
Modified: trunk/edk2/ShellPkg/Application/Shell/Shell.h
===================================================================
--- trunk/edk2/ShellPkg/Application/Shell/Shell.h 2015-09-10 02:45:30 UTC
(rev 18430)
+++ trunk/edk2/ShellPkg/Application/Shell/Shell.h 2015-09-10 03:08:56 UTC
(rev 18431)
@@ -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: trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c
===================================================================
--- trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c
2015-09-10 02:45:30 UTC (rev 18430)
+++ trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c
2015-09-10 03:08:56 UTC (rev 18431)
@@ -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