mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
fa3d30eaca
commit
484dd08c1a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue