From 51088d231d73cbe14516d553e97237e7f5a4f147 Mon Sep 17 00:00:00 2001 From: kavsrf Date: Sun, 19 Mar 2017 17:05:02 +0300 Subject: os hide prepare option --- Library/CommonLib/EfiConsole.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Library/CommonLib') diff --git a/Library/CommonLib/EfiConsole.c b/Library/CommonLib/EfiConsole.c index 63b32ae..3ab1515 100644 --- a/Library/CommonLib/EfiConsole.c +++ b/Library/CommonLib/EfiConsole.c @@ -204,11 +204,20 @@ AskAsciiString( CHAR8* prompt, CHAR8* str, UINTN max_len, - UINT8 visible) + UINT8 visible, + CHAR8* defStr) { UINTN len = 0; - OUT_PRINT(L"%a", prompt); - GetLine(&len, NULL, str, max_len, visible); + if (defStr == NULL) { + OUT_PRINT(L"%a", prompt); + } else { + OUT_PRINT(L"[%a] %a", defStr, prompt); + } + GetLine(&len, NULL, str, max_len, visible); + if (defStr != NULL && len == 0) { + AsciiStrCpyS(str, max_len, defStr); + len = AsciiStrLen(str); + } return (UINT32)len; } -- cgit v1.2.3