summaryrefslogtreecommitdiff
path: root/ShellPkg/Application
diff options
context:
space:
mode:
authorYang Jadis <jadis.yang@intel.com>2015-09-18 01:18:34 +0000
committerhwu1225 <hwu1225@Edk2>2015-09-18 01:18:34 +0000
commitef89277916d65046c9853e23aaf7db67ab34956f (patch)
tree1398549544aa7fd86410dec6f157baa496b4d971 /ShellPkg/Application
parentb523178555ad499ccd223b88258ec48f899edbad (diff)
downloadedk2-platforms-ef89277916d65046c9853e23aaf7db67ab34956f.tar.xz
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. (Sync patch r18491 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yang Jadis <jadis.yang@intel.com> 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/branches/UDK2015@18501 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Application')
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c2
1 files changed, 1 insertions, 1 deletions
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);