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
This commit is contained in:
Qiu Shumin 2015-09-10 03:08:56 +00:00 committed by shenshushi
parent 1cdc35c42c
commit 389824ffbe
2 changed files with 12 additions and 0 deletions

View File

@ -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_

View File

@ -359,6 +359,7 @@ CreatePopulateInstallShellParametersProtocol (
//
// Populate Argc and Argv
//
TrimSpaces (&FullCommandLine);
Status = ParseCommandLineToArgs(FullCommandLine,
&(*NewShellParameters)->Argv,
&(*NewShellParameters)->Argc);