]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: print only valid characters for file overwrite prompt
authorTapan Shah <tapandshah@hpe.com>
Fri, 28 Oct 2016 19:48:59 +0000 (12:48 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Mon, 31 Oct 2016 15:21:05 +0000 (08:21 -0700)
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>
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index 2389207a1dbe72cc163e82262cc2ca9af442b5e9..536db3c80599ff21e7798035e789b061c120c31a 100644 (file)
@@ -3403,7 +3403,8 @@ ShellPromptForResponse (
             break;\r
         }\r
       }\r
-      break;    case ShellPromptResponseTypeYesNoAllCancel:\r
+      break;\r
+      case ShellPromptResponseTypeYesNoAllCancel:\r
        if (Prompt != NULL) {\r
         ShellPrintEx(-1, -1, L"%s", Prompt);\r
       }\r
@@ -3421,7 +3422,11 @@ ShellPromptForResponse (
         if (EFI_ERROR(Status)) {\r
           break;\r
         }\r
-        ShellPrintEx(-1, -1, L"%c", Key.UnicodeChar);\r
+\r
+        if (Key.UnicodeChar <= 127 && Key.UnicodeChar >= 32) {\r
+          ShellPrintEx (-1, -1, L"%c", Key.UnicodeChar);\r
+        }\r
+\r
         switch (Key.UnicodeChar) {\r
           case L'Y':\r
           case L'y':\r