]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Skip leading tabs when processing command line and scripts
authorChris Phillips <chrisp@hp.com>
Fri, 15 Nov 2013 18:41:50 +0000 (18:41 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 15 Nov 2013 18:41:50 +0000 (18:41 +0000)
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

ShellPkg/Application/Shell/Shell.c
ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c

index 0ce1665d84577f6c4b443ac7c941fa9be0078783..1b52692ecec79793647ad32aec287171451938a3 100644 (file)
@@ -1415,9 +1415,9 @@ RunCommand(
   }\r
 \r
   //\r
-  // Remove any spaces at the beginning of the string.\r
+  // Remove any spaces and tabs at the beginning of the string.\r
   //\r
-  while (CleanOriginal[0] == L' ') {\r
+  while ((CleanOriginal[0] == L' ') || (CleanOriginal[0] == L'\t')) {\r
     CopyMem(CleanOriginal, CleanOriginal+1, StrSize(CleanOriginal) - sizeof(CleanOriginal[0]));\r
   }\r
 \r
index f5bc12638bac3ac52007adab60e078e4a653a0d7..791b1aed8faa06bd8352ad69a4a2f191a4b5581f 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Main file for If and else shell level 1 function.\r
 \r
+  Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -734,7 +735,11 @@ MoveToTagSpecial (
       continue;\r
     }\r
     CommandWalker = CommandName;\r
-    while (CommandWalker[0] == L' ') {\r
+\r
+    //\r
+    // Skip leading spaces and tabs.\r
+    //\r
+    while ((CommandWalker[0] == L' ') || (CommandWalker[0] == L'\t')) {\r
       CommandWalker++;\r
     }\r
     TempLocation  = StrStr(CommandWalker, L" ");\r
@@ -847,7 +852,7 @@ ShellCommandRunIf (
       NULL, \r
       STRING_TOKEN (STR_SYNTAX_NO_MATCHING), \r
       gShellLevel1HiiHandle, \r
-      L"EnfIf", \r
+      L"EndIf", \r
       L"If", \r
       CurrentScriptFile!=NULL \r
         && CurrentScriptFile->CurrentCommand!=NULL\r
index 6f67f49aea144ce11585e778f7a2dea59036ad96..5dca0629dbebef0d9e3362d1e3e15e4f6262bbab 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Main file for NULL named library for level 1 shell command functions.\r
 \r
+  Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -150,7 +151,11 @@ TestNodeForMove (
   }\r
 \r
   CommandNameWalker = CommandName;\r
-  while(CommandNameWalker[0] == L' ') {\r
+\r
+  //\r
+  // Skip leading spaces and tabs.\r
+  //\r
+  while ((CommandNameWalker[0] == L' ') || (CommandNameWalker[0] == L'\t')) {\r
     CommandNameWalker++;\r
   }\r
   TempLocation  = StrStr(CommandNameWalker, L" ");\r