From df27ab373b360e4335b43f1fc5b938e6e48d9d84 Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Fri, 5 Feb 1999 19:27:21 +0000 Subject: [PATCH] incorporated changes from Boudewijn svn path=/trunk/; revision=207 --- reactos/lib/crtdll/conio/getch.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/lib/crtdll/conio/getch.c b/reactos/lib/crtdll/conio/getch.c index 4ca74b0b787..5fc66ed507a 100644 --- a/reactos/lib/crtdll/conio/getch.c +++ b/reactos/lib/crtdll/conio/getch.c @@ -23,7 +23,7 @@ int _getch(void) { - DWORD NumberOfCharsRead; + DWORD NumberOfCharsRead = 0; char c; if (char_avail) { @@ -31,12 +31,12 @@ _getch(void) char_avail = 0; } else - { + { + ReadConsoleA(filehnd(stdin->_file), &c,1,&NumberOfCharsRead ,NULL); - if( !ReadFile(filehnd(stdin->_file), &c,1,&NumberOfCharsRead ,NULL)) - return -1; - } - printk("%c",c); + if ( c == 10 ) + c = 13; + putchar(c); return c; } \ No newline at end of file