https://git.reactos.org/?p=reactos.git;a=commitdiff;h=98353cdb376fa507b9201…
commit 98353cdb376fa507b9201982ed956092149de363
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Nov 16 21:48:51 2023 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Nov 16 21:58:54 2023 +0100
[CMD] Use correct console input mode in ConInString()
ENABLE_PROCESSED_INPUT is necessary to correctly deal with CR-LF
and display it only when necessary. Fixes cmd:batch winetests.
Addendum to commit db219e45c
---
base/shell/cmd/console.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/base/shell/cmd/console.c b/base/shell/cmd/console.c
index ba718fbc076..de35fa7f373 100644
--- a/base/shell/cmd/console.c
+++ b/base/shell/cmd/console.c
@@ -96,7 +96,7 @@ VOID ConInString(LPTSTR lpInput, DWORD dwLength)
hFile = GetStdHandle(STD_INPUT_HANDLE);
GetConsoleMode(hFile, &dwOldMode);
- SetConsoleMode(hFile, ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT);
+ SetConsoleMode(hFile, ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT |
ENABLE_ECHO_INPUT);
ReadFile(hFile, (PVOID)pBuf, dwLength - 1, &dwRead, NULL);
@@ -106,10 +106,9 @@ VOID ConInString(LPTSTR lpInput, DWORD dwLength)
#endif
for (p = lpInput; *p; p++)
{
- if (*p == _T('\r')) // Terminate at the next carriage-return.
+ if (*p == _T('\r')) // Terminate at the carriage-return.
{
*p = _T('\0');
- ConOutChar(_T('\n')); // Output newline as well.
break;
}
}