mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
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
|
// get the item VALUE for a previous flag
|
||||||
//
|
//
|
||||||
if (StrStr(Argv[LoopCounter], L" ") == NULL) {
|
CurrentValueSize = ValueSize + StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
|
||||||
CurrentValueSize = ValueSize + StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
|
CurrentItemPackage->Value = ReallocatePool(ValueSize, CurrentValueSize, CurrentItemPackage->Value);
|
||||||
CurrentItemPackage->Value = ReallocatePool(ValueSize, CurrentValueSize, CurrentItemPackage->Value);
|
ASSERT(CurrentItemPackage->Value != NULL);
|
||||||
ASSERT(CurrentItemPackage->Value != NULL);
|
if (ValueSize == 0) {
|
||||||
if (ValueSize == 0) {
|
StrnCpy(CurrentItemPackage->Value, Argv[LoopCounter], CurrentValueSize/sizeof(CHAR16) - 1);
|
||||||
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);
|
|
||||||
} else {
|
} else {
|
||||||
//
|
StrnCat(CurrentItemPackage->Value, L" ", CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
|
||||||
// the parameter has spaces. must be quoted.
|
StrnCat(CurrentItemPackage->Value, Argv[LoopCounter], CurrentValueSize/sizeof(CHAR16) - 1 - StrLen(CurrentItemPackage->Value));
|
||||||
//
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
ValueSize += StrSize(Argv[LoopCounter]) + sizeof(CHAR16);
|
||||||
|
|
||||||
GetItemValue--;
|
GetItemValue--;
|
||||||
if (GetItemValue == 0) {
|
if (GetItemValue == 0) {
|
||||||
InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
|
InsertHeadList(*CheckPackage, &CurrentItemPackage->Link);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user