Revision: 14850
          http://sourceforge.net/p/edk2/code/14850
Author:   jcarsey
Date:     2013-11-15 18:41:50 +0000 (Fri, 15 Nov 2013)
Log Message:
-----------
ShellPkg: Skip leading tabs when processing command line and scripts

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Phillips <[email protected]>
reviewed-by: Jaben Carsey <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Application/Shell/Shell.c
    trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
    
trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c

Modified: trunk/edk2/ShellPkg/Application/Shell/Shell.c
===================================================================
--- trunk/edk2/ShellPkg/Application/Shell/Shell.c       2013-11-15 18:39:26 UTC 
(rev 14849)
+++ trunk/edk2/ShellPkg/Application/Shell/Shell.c       2013-11-15 18:41:50 UTC 
(rev 14850)
@@ -1415,9 +1415,9 @@
   }
 
   //
-  // 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]));
   }
 

Modified: trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c 2013-11-15 
18:39:26 UTC (rev 14849)
+++ trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c 2013-11-15 
18:41:50 UTC (rev 14850)
@@ -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 @@
       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 @@
       NULL, 
       STRING_TOKEN (STR_SYNTAX_NO_MATCHING), 
       gShellLevel1HiiHandle, 
-      L"EnfIf", 
+      L"EndIf", 
       L"If", 
       CurrentScriptFile!=NULL 
         && CurrentScriptFile->CurrentCommand!=NULL

Modified: 
trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
===================================================================
--- 
trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
 2013-11-15 18:39:26 UTC (rev 14849)
+++ 
trunk/edk2/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.c
 2013-11-15 18:41:50 UTC (rev 14850)
@@ -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 @@
   }
 
   CommandNameWalker = CommandName;
-  while(CommandNameWalker[0] == L' ') {
+
+  //
+  // Skip leading spaces and tabs.
+  //
+  while ((CommandNameWalker[0] == L' ') || (CommandNameWalker[0] == L'\t')) {
     CommandNameWalker++;
   }
   TempLocation  = StrStr(CommandNameWalker, L" ");

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to