ShellPkg: Fix Shell does not support ASCII pipe(|a).
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@18452 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1578,11 +1578,18 @@ RunSplitCommand(
|
|||||||
SHELL_FREE_NON_NULL(OurCommandLine);
|
SHELL_FREE_NON_NULL(OurCommandLine);
|
||||||
SHELL_FREE_NON_NULL(NextCommandLine);
|
SHELL_FREE_NON_NULL(NextCommandLine);
|
||||||
return (EFI_INVALID_PARAMETER);
|
return (EFI_INVALID_PARAMETER);
|
||||||
} else if (NextCommandLine[0] != CHAR_NULL &&
|
} else if (NextCommandLine[0] == L'a' &&
|
||||||
NextCommandLine[0] == L'a' &&
|
(NextCommandLine[1] == L' ' || NextCommandLine[1] == CHAR_NULL)
|
||||||
NextCommandLine[1] == L' '
|
){
|
||||||
){
|
|
||||||
CopyMem(NextCommandLine, NextCommandLine+1, StrSize(NextCommandLine) - sizeof(NextCommandLine[0]));
|
CopyMem(NextCommandLine, NextCommandLine+1, StrSize(NextCommandLine) - sizeof(NextCommandLine[0]));
|
||||||
|
while (NextCommandLine[0] == L' ') {
|
||||||
|
CopyMem(NextCommandLine, NextCommandLine+1, StrSize(NextCommandLine) - sizeof(NextCommandLine[0]));
|
||||||
|
}
|
||||||
|
if (NextCommandLine[0] == CHAR_NULL) {
|
||||||
|
SHELL_FREE_NON_NULL(OurCommandLine);
|
||||||
|
SHELL_FREE_NON_NULL(NextCommandLine);
|
||||||
|
return (EFI_INVALID_PARAMETER);
|
||||||
|
}
|
||||||
Unicode = FALSE;
|
Unicode = FALSE;
|
||||||
} else {
|
} else {
|
||||||
Unicode = TRUE;
|
Unicode = TRUE;
|
||||||
@ -1883,6 +1890,13 @@ VerifySplit(
|
|||||||
CONST CHAR16 *TempSpot;
|
CONST CHAR16 *TempSpot;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
|
//
|
||||||
|
// If this was the only item, then get out
|
||||||
|
//
|
||||||
|
if (!ContainsSplit(CmdLine)) {
|
||||||
|
return (EFI_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Verify up to the pipe or end character
|
// Verify up to the pipe or end character
|
||||||
//
|
//
|
||||||
@ -1891,17 +1905,17 @@ VerifySplit(
|
|||||||
return (Status);
|
return (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// If this was the only item, then get out
|
|
||||||
//
|
|
||||||
if (!ContainsSplit(CmdLine)) {
|
|
||||||
return (EFI_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// recurse to verify the next item
|
// recurse to verify the next item
|
||||||
//
|
//
|
||||||
TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1;
|
TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1;
|
||||||
|
if (*TempSpot == L'a' &&
|
||||||
|
(*(TempSpot + 1) == L' ' || *(TempSpot + 1) == CHAR_NULL)
|
||||||
|
) {
|
||||||
|
// If it's an ASCII pipe '|a'
|
||||||
|
TempSpot += 1;
|
||||||
|
}
|
||||||
|
|
||||||
return (VerifySplit(TempSpot));
|
return (VerifySplit(TempSpot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user