Unified · Split
| @@ -11,16 +11,6 @@ · 10 unmodified lines | |||
| 11 | #undef write | 11 | #undef write |
| 12 | #undef read | 12 | #undef read |
| 13 | 13 | ||
| 14 | #ifndef WINDOWS | ||
| 15 | /* get raw character from console without echo */ | ||
| 16 | static int | ||
| 17 | _getch(void) | ||
| 18 | { | ||
| 19 | /* TODO */ | ||
| 20 | return -1; | ||
| 21 | } | ||
| 22 | #endif | ||
| 23 | |||
| 24 | void (*consdebug)(void) = 0; | 14 | void (*consdebug)(void) = 0; |
| 25 | void (*screenputs)(char*, int) = 0; | 15 | void (*screenputs)(char*, int) = 0; |
| 26 | 16 | ||
| @@ -582,15 +572,8 @@ consclose(Chan *c) · 555 unmodified lines | |||
| 582 | static int | 572 | static int |
| 583 | readcons(Queue *q, char *buf, int n) | 573 | readcons(Queue *q, char *buf, int n) |
| 584 | { | 574 | { |
| 585 | while(screenputs==0 && !qcanread(q)){ | 575 | if(screenputs==0 && !qcanread(q)) |
| 586 | int c; | 576 | return read(0, buf, n); |
| 587 | |||
| 588 | if((c = _getch()) == -1) | ||
| 589 | return read(0, buf, n); | ||
| 590 | if(c == '\r') | ||
| 591 | c = '\n'; | ||
| 592 | kbdputc(q, c); | ||
| 593 | } | ||
| 594 | return qread(q, buf, n); | 577 | return qread(q, buf, n); |
| 595 | } | 578 | } |
| 596 | 579 | ||