From fb977e33950abd0e1ac50f17c90b05f0593fd4d6 Mon Sep 17 00:00:00 2001 From: Yang Jadis Date: Thu, 17 Sep 2015 01:42:59 +0000 Subject: [PATCH] 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. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yang Jadis Signed-off-by: Qiu Shumin Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18491 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Application/Shell/ShellParametersProtocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c index bc19df7e93..b404987340 100644 --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c @@ -206,6 +206,7 @@ ParseCommandLineToArgs( return (EFI_SUCCESS); } + TrimSpaces(&(CHAR16*)CommandLine); Size = StrSize(CommandLine); TempParameter = AllocateZeroPool(Size); if (TempParameter == NULL) { @@ -359,7 +360,6 @@ CreatePopulateInstallShellParametersProtocol ( // // Populate Argc and Argv // - TrimSpaces (&FullCommandLine); Status = ParseCommandLineToArgs(FullCommandLine, &(*NewShellParameters)->Argv, &(*NewShellParameters)->Argc);