summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLib/UefiShellLib.c
diff options
context:
space:
mode:
authorTapan Shah <tapandshah@hpe.com>2016-10-28 12:48:59 -0700
committerJaben Carsey <jaben.carsey@intel.com>2016-10-31 08:21:05 -0700
commitac55b925548f3b33f2bc93e603ecffe4a6cb191a (patch)
treedfb8fd6e3620c348edb8d05d6793d50bded9687f /ShellPkg/Library/UefiShellLib/UefiShellLib.c
parentb3400560603bcfaadc08e82a846933446b5afed3 (diff)
downloadedk2-ac55b925548f3b33f2bc93e603ecffe4a6cb191a.tar.gz
edk2-ac55b925548f3b33f2bc93e603ecffe4a6cb191a.tar.bz2
edk2-ac55b925548f3b33f2bc93e603ecffe4a6cb191a.zip
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 <tapandshah@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c9
1 files changed, 7 insertions, 2 deletions
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':