[CMD] Do not overwrite input string on Ctrl+C (#852)
authorStanislav Motylkov <x86corez@gmail.com>
Thu, 13 Sep 2018 09:47:01 +0000 (12:47 +0300)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Thu, 13 Sep 2018 09:47:01 +0000 (11:47 +0200)
CORE-15029

base/shell/cmd/cmdinput.c

index 061b910..e609c5a 100644 (file)
@@ -457,6 +457,13 @@ BOOL ReadCommand(LPTSTR str, INT maxlen)
                     if (!bCtrlBreak)
                         break;
 
+                    /*
+                     * Fully print the entered string
+                     * so the command prompt would not overwrite it.
+                     */
+                    SetCursorXY(orgx, orgy);
+                    ConOutPrintf(_T("%s"), str);
+
                     /*
                      * A Ctrl-C. Do not clear the command line,
                      * but return an empty string in str.