]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
ShellPkg: Skip leading tabs when processing command line and scripts
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel1CommandsLib / If.c
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