_getch() can return '\r' on Windows

This commit is contained in:
Asanka Herath
2010-05-26 10:16:36 -04:00
parent 7b8ebf0efe
commit a750f29cda

View File

@@ -77,7 +77,7 @@ read_string(const char *preprompt, const char *prompt,
p = buf; p = buf;
while(intr_flag == 0){ while(intr_flag == 0){
c = ((echo)? _getche(): _getch()); c = ((echo)? _getche(): _getch());
if(c == '\n') if(c == '\n' || c == '\r')
break; break;
if(of == 0) if(of == 0)
*p++ = c; *p++ = c;