mirror of https://github.com/acidanthera/audk.git
ShellPkg: Add support for UEFI Shell 2.1 spec command line comments
Example: Shell> echo "You are ^#1!" # Testing echo You are #1! Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15871 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a29117bf9e
commit
d41a79a0da
|
@ -2457,6 +2457,24 @@ RunCommand(
|
|||
|
||||
TrimSpaces(&CleanOriginal);
|
||||
|
||||
//
|
||||
// NULL out comments (leveraged from RunScriptFileHandle() ).
|
||||
// The # character on a line is used to denote that all characters on the same line
|
||||
// and to the right of the # are to be ignored by the shell.
|
||||
// Afterward, again remove spaces, in case any were between the last command-parameter and '#'.
|
||||
//
|
||||
for (TempWalker = CleanOriginal; TempWalker != NULL && *TempWalker != CHAR_NULL; TempWalker++) {
|
||||
if (*TempWalker == L'^') {
|
||||
if (*(TempWalker + 1) == L'#') {
|
||||
CopyMem (TempWalker, TempWalker + 1, StrSize (TempWalker) - sizeof (TempWalker[0]));
|
||||
}
|
||||
} else if (*TempWalker == L'#') {
|
||||
*TempWalker = CHAR_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
TrimSpaces(&CleanOriginal);
|
||||
|
||||
//
|
||||
// Handle case that passed in command line is just 1 or more " " characters.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue