diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2015-04-01 00:49:05 +0000 |
---|---|---|
committer | shenshushi <shenshushi@Edk2> | 2015-04-01 00:49:05 +0000 |
commit | 484dd08c1ab97945a579e715664e68499fcf55a2 (patch) | |
tree | bd00ef76bf16143c4822b5d8d62b245a6c26335c /ShellPkg | |
parent | fa3d30eaca3d11794be64bc1622102b4f90e06f4 (diff) | |
download | edk2-484dd08c1ab97945a579e715664e68499fcf55a2.zip edk2-484dd08c1ab97945a579e715664e68499fcf55a2.tar.gz edk2-484dd08c1ab97945a579e715664e68499fcf55a2.tar.bz2 |
ShellPkg: Remove extra quotes surrounding flag values.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17086 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index da787f6..f82668b 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -2105,36 +2105,17 @@ InternalCommandLineParse ( //
// 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);
|