Revision: 17086
          http://sourceforge.net/p/edk2/code/17086
Author:   shenshushi
Date:     2015-04-01 00:49:05 +0000 (Wed, 01 Apr 2015)
Log Message:
-----------
ShellPkg: Remove extra quotes surrounding flag values.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c

Modified: trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c     2015-03-31 
08:24:58 UTC (rev 17085)
+++ trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c     2015-04-01 
00:49:05 UTC (rev 17086)
@@ -2105,36 +2105,17 @@
       //
       // get the item VALUE for a previous flag
       //
-      if (StrStr(Argv[LoopCounter], L" ") == NULL) {
-        CurrentValueSize = ValueSize + StrSize(Argv[LoopCounter]) + 
sizeof(CHAR16);
-        CurrentItemPackage->Value = ReallocatePool(ValueSize, 
CurrentValueSize, CurrentItemPackage->Value);
-        ASSERT(CurrentItemPackage->Value != NULL);
-        if (ValueSize == 0) {
-          StrnCpy(CurrentItemPackage->Value, Argv[LoopCounter], 
CurrentValueSize/sizeof(CHAR16) - 1);
-        } else {
-          StrnCat(CurrentItemPackage->Value, L" ", 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-          StrnCat(CurrentItemPackage->Value, Argv[LoopCounter], 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-        }
-        ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
+      CurrentValueSize = ValueSize + StrSize(Argv[LoopCounter]) + 
sizeof(CHAR16);
+      CurrentItemPackage->Value = ReallocatePool(ValueSize, CurrentValueSize, 
CurrentItemPackage->Value);
+      ASSERT(CurrentItemPackage->Value != NULL);
+      if (ValueSize == 0) {
+        StrnCpy(CurrentItemPackage->Value, Argv[LoopCounter], 
CurrentValueSize/sizeof(CHAR16) - 1);
       } else {
-        //
-        // the parameter has spaces.  must be quoted.
-        //
-        CurrentValueSize =  ValueSize + StrSize(Argv[LoopCounter]) + 
sizeof(CHAR16) + sizeof(CHAR16) + sizeof(CHAR16);
-        CurrentItemPackage->Value = ReallocatePool(ValueSize, 
CurrentValueSize, CurrentItemPackage->Value);
-        ASSERT(CurrentItemPackage->Value != NULL);
-        if (ValueSize == 0) {
-          StrnCpy(CurrentItemPackage->Value, L"\"", 
CurrentValueSize/sizeof(CHAR16) - 1);
-          StrnCat(CurrentItemPackage->Value, Argv[LoopCounter], 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-          StrnCat(CurrentItemPackage->Value, L"\"", 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-        } else {
-          StrnCat(CurrentItemPackage->Value, L" ", 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-          StrnCat(CurrentItemPackage->Value, L"\"", 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-          StrnCat(CurrentItemPackage->Value, Argv[LoopCounter], 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-          StrnCat(CurrentItemPackage->Value, L"\"", 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
-       }
-        ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
+        StrnCat(CurrentItemPackage->Value, L" ", 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
+        StrnCat(CurrentItemPackage->Value, Argv[LoopCounter], 
CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
       }
+      ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
+      
       GetItemValue--;
       if (GetItemValue == 0) {
         InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to