hopeful it is last bug in choice.c when you type choice "sadsa" it did not response...
authorMagnus Olsen <magnus@greatlord.com>
Wed, 6 Jul 2005 14:06:33 +0000 (14:06 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Wed, 6 Jul 2005 14:06:33 +0000 (14:06 +0000)
svn path=/trunk/; revision=16457

reactos/subsys/system/cmd/choice.c

index 45705ce..4a01855 100644 (file)
@@ -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;