From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2355.austin.hpe.com (g2t2355.austin.hpe.com [15.233.44.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C0DB181DF4 for ; Fri, 28 Oct 2016 12:49:07 -0700 (PDT) Received: from SHAHTA6.americas.hpqcorp.net (unknown [16.116.208.50]) by g2t2355.austin.hpe.com (Postfix) with ESMTP id 5A5C14C; Fri, 28 Oct 2016 19:49:07 +0000 (UTC) From: Tapan Shah To: edk2-devel@lists.01.org Cc: jaben.carsey@intel.com, Tapan Shah Date: Fri, 28 Oct 2016 14:48:59 -0500 Message-Id: <1477684139-11728-1-git-send-email-tapandshah@hpe.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [PATCH] ShellPkg: print only valid characters for file overwrite prompt X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 19:49:07 -0000 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 --- ShellPkg/Library/UefiShellLib/UefiShellLib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 2389207..536db3c 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': -- 1.9.5.msysgit.0