EditTitleBar - Remove ASSERT. Complete display output for Disk and Memory output.

HexEdit      - Add more user input verification.  Fix output display.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11517 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2011-04-11 22:00:31 +00:00
parent 75e55c54be
commit 411a3c3929
2 changed files with 12 additions and 9 deletions

View File

@ -185,7 +185,7 @@ MainTitleBarRefresh (
// //
// Print the offset. // Print the offset.
// //
ASSERT(FALSE); ShellPrintEx (-1,-1, L"Offset %X | Size %X", Offset, Size);
case FileTypeFileBuffer: case FileTypeFileBuffer:
break; break;
default: default:

View File

@ -147,12 +147,15 @@ ShellCommandRunHexEdit (
} }
Name = ShellCommandLineGetRawValue(Package, 1); Name = ShellCommandLineGetRawValue(Package, 1);
if (WhatToDo == FileTypeNone && Name != NULL) { if (WhatToDo == FileTypeNone && Name != NULL) {
if (!IsValidFileName(Name)) { if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Name); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else if (!IsValidFileName(Name)) {
WhatToDo = FileTypeFileBuffer; ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Name);
} ShellStatus = SHELL_INVALID_PARAMETER;
} else {
WhatToDo = FileTypeFileBuffer;
}
} else if (WhatToDo == FileTypeNone) { } else if (WhatToDo == FileTypeNone) {
if (gEfiShellProtocol->GetCurDir(NULL) == NULL) { if (gEfiShellProtocol->GetCurDir(NULL) == NULL) {
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
@ -235,7 +238,7 @@ ShellCommandRunHexEdit (
// //
// back up the status string // back up the status string
// //
Buffer = CatSPrint (NULL, L"%s", StatusBarGetString()); Buffer = CatSPrint (NULL, L"%s\r\n", StatusBarGetString());
} }
} }
@ -261,7 +264,7 @@ ShellCommandRunHexEdit (
// //
// print out the status string // print out the status string
// //
ShellPrintEx(-1, -1, L"%s", gShellDebug1HiiHandle, Buffer); ShellPrintEx(-1, -1, L"%s", Buffer);
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
} }