summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorChris Phillips <chrisp@hp.com>2013-11-15 18:41:50 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2013-11-15 18:41:50 +0000
commit13acebbdefedb58ffd9f8e90ebc740404dcd1726 (patch)
tree4bd5242b9b9ab59771db793d7b0450d735e33d6d /ShellPkg
parent6813ba402a7c52e80cc7aa4eb2a454a6b90ae011 (diff)
downloadedk2-13acebbdefedb58ffd9f8e90ebc740404dcd1726.zip
edk2-13acebbdefedb58ffd9f8e90ebc740404dcd1726.tar.gz
edk2-13acebbdefedb58ffd9f8e90ebc740404dcd1726.tar.bz2
ShellPkg: Skip leading tabs when processing command line and scripts
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hp.com> reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14850 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Application/Shell/Shell.c4
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/If.c9
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c7
3 files changed, 15 insertions, 5 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 0ce1665..1b52692 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1415,9 +1415,9 @@ RunCommand(
}
//
- // Remove any spaces at the beginning of the string.
+ // Remove any spaces and tabs at the beginning of the string.
//
- while (CleanOriginal[0] == L' ') {
+ while ((CleanOriginal[0] == L' ') || (CleanOriginal[0] == L'\t')) {
CopyMem(CleanOriginal, CleanOriginal+1, StrSize(CleanOriginal) - sizeof(CleanOriginal[0]));
}
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
index f5bc126..791b1ae 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
@@ -1,6 +1,7 @@
/** @file
Main file for If and else shell level 1 function.
+ Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -734,7 +735,11 @@ MoveToTagSpecial (
continue;
}
CommandWalker = CommandName;
- while (CommandWalker[0] == L' ') {
+
+ //
+ // Skip leading spaces and tabs.
+ //
+ while ((CommandWalker[0] == L' ') || (CommandWalker[0] == L'\t')) {
CommandWalker++;
}
TempLocation = StrStr(CommandWalker, L" ");
@@ -847,7 +852,7 @@ ShellCommandRunIf (
NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle,
- L"EnfIf",
+ L"EndIf",
L"If",
CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
index 6f67f49..5dca062 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
@@ -1,6 +1,7 @@
/** @file
Main file for NULL named library for level 1 shell command functions.
+ Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -150,7 +151,11 @@ TestNodeForMove (
}
CommandNameWalker = CommandName;
- while(CommandNameWalker[0] == L' ') {
+
+ //
+ // Skip leading spaces and tabs.
+ //
+ while ((CommandNameWalker[0] == L' ') || (CommandNameWalker[0] == L'\t')) {
CommandNameWalker++;
}
TempLocation = StrStr(CommandNameWalker, L" ");