From c9b36033d88a5075d5052dc2072b3b4fedbfcebb Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Wed, 6 Jul 2005 14:06:33 +0000 Subject: [PATCH] hopeful it is last bug in choice.c when you type choice "sadsa" it did not response on key press at all. svn path=/trunk/; revision=16457 --- reactos/subsys/system/cmd/choice.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/system/cmd/choice.c b/reactos/subsys/system/cmd/choice.c index 45705ce4d8c..4a01855b847 100644 --- a/reactos/subsys/system/cmd/choice.c +++ b/reactos/subsys/system/cmd/choice.c @@ -105,7 +105,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param) { TCHAR szMsg[RC_STRING_MAX_SIZE]; LPTSTR lpOptions; - TCHAR Options[4]; + TCHAR Options[6]; LPTSTR lpText = NULL; BOOL bNoPrompt = FALSE; BOOL bCaseSensitive = FALSE; @@ -240,16 +240,26 @@ CommandChoice (LPTSTR cmd, LPTSTR param) { ConInKey (&ir); + if (bNoPrompt != FALSE) + { val = IsKeyInString (lpOptions, #ifdef _UNICODE ir.Event.KeyEvent.uChar.UnicodeChar, #else ir.Event.KeyEvent.uChar.AsciiChar, -#endif /* _UNICODE */ +#endif bCaseSensitive); + } + else + { + + val = IsKeyInString (lpOptions, + ir.Event.KeyEvent.uChar.UnicodeChar, + bCaseSensitive); + } if (val >= 0) - { + { ConOutPrintf (_T("%c\n"), lpOptions[val]); nErrorLevel = val + 1;