remove redirection command line updating from the shell core code.

add redirection command line updating to the redirection support function (UpdateStdInStdOutStdErr).
add more user input verification to redirection.

reduce user input verification from inside quoted parameters.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11460 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-03-30 21:04:57 +00:00
parent 33c031ee20
commit fb84495a78
3 changed files with 59 additions and 32 deletions

View File

@ -1427,21 +1427,6 @@ RunCommand(
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_REDIR), ShellInfoObject.HiiHandle);
}
} else {
//
// remove the < and/or > from the command line now
//
for (TempLocation3 = PostVariableCmdLine ; TempLocation3 != NULL && *TempLocation3 != CHAR_NULL ; TempLocation3++) {
if (*TempLocation3 == L'^') {
if (*(TempLocation3+1) == L'<' || *(TempLocation3+1) == L'>') {
CopyMem(TempLocation3, TempLocation3+1, StrSize(TempLocation3) - sizeof(TempLocation3[0]));
}
} else if (*TempLocation3 == L'>') {
*TempLocation3 = CHAR_NULL;
} else if ((*TempLocation3 == L'1' || *TempLocation3 == L'2')&&(*(TempLocation3+1) == L'>')) {
*TempLocation3 = CHAR_NULL;
}
}
while (PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] == L' ') {
PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] = CHAR_NULL;
}