summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2015-09-10 03:08:56 +0000
committershenshushi <shenshushi@Edk2>2015-09-10 03:08:56 +0000
commit389824ffbe95c477ad605b56394798905ad13853 (patch)
tree100299e8aad43603edbc10c0f00f6ee98c59ad4a /ShellPkg
parent1cdc35c42ca35c6b66ea28109c3ad690ef622b82 (diff)
downloadedk2-389824ffbe95c477ad605b56394798905ad13853.tar.gz
edk2-389824ffbe95c477ad605b56394798905ad13853.tar.bz2
edk2-389824ffbe95c477ad605b56394798905ad13853.zip
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 <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@18431 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/Shell.h11
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c1
2 files changed, 12 insertions, 0 deletions
diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h
index 4d804fc45b..b6686256aa 100644
--- a/ShellPkg/Application/Shell/Shell.h
+++ b/ShellPkg/Application/Shell/Shell.h
@@ -360,5 +360,16 @@ FindFirstCharacter(
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_
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c
index 1c1367bdf8..bc19df7e93 100644
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.c
+++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c
@@ -359,6 +359,7 @@ CreatePopulateInstallShellParametersProtocol (
//
// Populate Argc and Argv
//
+ TrimSpaces (&FullCommandLine);
Status = ParseCommandLineToArgs(FullCommandLine,
&(*NewShellParameters)->Argv,
&(*NewShellParameters)->Argc);