mirror of https://github.com/acidanthera/audk.git
ShellPkg: Remove ASSERT
This change removes ASSERT statements and replaces them with logic to break out of the loop. This both prevents spinning forever and prevents processing the returned data from the function that failed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15133 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
974d61171f
commit
31b018a663
|
@ -3280,7 +3280,9 @@ ShellPromptForResponse (
|
|||
//
|
||||
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
break;
|
||||
}
|
||||
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
|
||||
if (Key.UnicodeChar == L'Q' || Key.UnicodeChar ==L'q') {
|
||||
*Resp = ShellPromptResponseQuit;
|
||||
|
@ -3303,7 +3305,9 @@ ShellPromptForResponse (
|
|||
}
|
||||
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
break;
|
||||
}
|
||||
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
|
||||
switch (Key.UnicodeChar) {
|
||||
case L'Y':
|
||||
|
@ -3335,7 +3339,9 @@ ShellPromptForResponse (
|
|||
}
|
||||
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
break;
|
||||
}
|
||||
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
|
||||
switch (Key.UnicodeChar) {
|
||||
case L'Y':
|
||||
|
@ -3374,7 +3380,9 @@ ShellPromptForResponse (
|
|||
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
|
||||
if (Type == ShellPromptResponseTypeEnterContinue) {
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
break;
|
||||
}
|
||||
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
|
||||
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
|
||||
*Resp = ShellPromptResponseContinue;
|
||||
|
@ -3404,7 +3412,9 @@ ShellPromptForResponse (
|
|||
}
|
||||
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
break;
|
||||
}
|
||||
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
|
||||
switch (Key.UnicodeChar) {
|
||||
case L'Y':
|
||||
|
@ -3429,7 +3439,9 @@ ShellPromptForResponse (
|
|||
}
|
||||
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
break;
|
||||
}
|
||||
ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);
|
||||
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue