From: Tapan Shah Date: Fri, 28 Oct 2016 19:48:59 +0000 (-0700) Subject: ShellPkg: print only valid characters for file overwrite prompt X-Git-Tag: edk2-stable201903~5389 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ac55b925548f3b33f2bc93e603ecffe4a6cb191a;p=mirror_edk2.git ShellPkg: print only valid characters for file overwrite prompt When copy command prompts to overwrite an existing file, pressing backspace continuously removes everything including the shell prompt. So print only valid characters for file overwrite prompt. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah Reviewed-by: Jaben Carsey --- diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 2389207a1d..536db3c805 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -3403,7 +3403,8 @@ ShellPromptForResponse ( break; } } - break; case ShellPromptResponseTypeYesNoAllCancel: + break; + case ShellPromptResponseTypeYesNoAllCancel: if (Prompt != NULL) { ShellPrintEx(-1, -1, L"%s", Prompt); } @@ -3421,7 +3422,11 @@ ShellPromptForResponse ( if (EFI_ERROR(Status)) { break; } - ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar); + + if (Key.UnicodeChar <= 127 && Key.UnicodeChar >= 32) { + ShellPrintEx (-1, -1, L"%c", Key.UnicodeChar); + } + switch (Key.UnicodeChar) { case L'Y': case L'y':