mirror of https://github.com/acidanthera/audk.git
ShellPkg: Remove redundant quotes for command 'FOR' in Shell.
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@16121 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
926be9d10c
commit
3a3395f06b
|
@ -294,6 +294,7 @@ ShellCommandRunFor (
|
||||||
SCRIPT_FILE *CurrentScriptFile;
|
SCRIPT_FILE *CurrentScriptFile;
|
||||||
CHAR16 *ArgSet;
|
CHAR16 *ArgSet;
|
||||||
CHAR16 *ArgSetWalker;
|
CHAR16 *ArgSetWalker;
|
||||||
|
CHAR16 *Parameter;
|
||||||
UINTN ArgSize;
|
UINTN ArgSize;
|
||||||
UINTN LoopVar;
|
UINTN LoopVar;
|
||||||
SHELL_FOR_INFO *Info;
|
SHELL_FOR_INFO *Info;
|
||||||
|
@ -309,6 +310,7 @@ ShellCommandRunFor (
|
||||||
ShellStatus = SHELL_SUCCESS;
|
ShellStatus = SHELL_SUCCESS;
|
||||||
ArgSetWalker = NULL;
|
ArgSetWalker = NULL;
|
||||||
TempString = NULL;
|
TempString = NULL;
|
||||||
|
Parameter = NULL;
|
||||||
FirstPass = FALSE;
|
FirstPass = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -391,9 +393,15 @@ ShellCommandRunFor (
|
||||||
ShellCloseFileMetaArg(&FileList);
|
ShellCloseFileMetaArg(&FileList);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
|
Parameter = gEfiShellParametersProtocol->Argv[LoopVar];
|
||||||
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, gEfiShellParametersProtocol->Argv[LoopVar], 0);
|
if (Parameter[0] == L'\"' && Parameter[StrLen(Parameter)-1] == L'\"') {
|
||||||
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
|
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" ", 0);
|
||||||
|
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, Parameter, 0);
|
||||||
|
} else {
|
||||||
|
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
|
||||||
|
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, Parameter, 0);
|
||||||
|
ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ArgSet == NULL) {
|
if (ArgSet == NULL) {
|
||||||
|
@ -692,12 +700,6 @@ ShellCommandRunFor (
|
||||||
InternalUpdateAliasOnList(Info->ReplacementName, TempString, &CurrentScriptFile->SubstList);
|
InternalUpdateAliasOnList(Info->ReplacementName, TempString, &CurrentScriptFile->SubstList);
|
||||||
Info->CurrentValue += StrLen(TempString);
|
Info->CurrentValue += StrLen(TempString);
|
||||||
|
|
||||||
if (Info->CurrentValue[0] == L'\"') {
|
|
||||||
Info->CurrentValue++;
|
|
||||||
}
|
|
||||||
while (Info->CurrentValue[0] == L' ') {
|
|
||||||
Info->CurrentValue++;
|
|
||||||
}
|
|
||||||
if (Info->CurrentValue[0] == L'\"') {
|
if (Info->CurrentValue[0] == L'\"') {
|
||||||
Info->CurrentValue++;
|
Info->CurrentValue++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue