diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-13 03:27:25 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-13 03:27:25 +0000 |
commit | 07cfc314441839d75e2ef8420a246f3dcbc517b4 (patch) | |
tree | 47e0f98c50e340d5bed7f292d1ac186c86facfbe | |
parent | bb45ddca85109a945c8293c180febd534d35b0fb (diff) | |
download | plan9front-07cfc314441839d75e2ef8420a246f3dcbc517b4.tar.xz |
fix broken kbdproc buffering
-rw-r--r-- | sys/src/cmd/rio/rio.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index 682512bee..04e0f8b54 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -1232,7 +1232,7 @@ kbdproc(void *arg) Rune r; e = buf + sizeof(buf); - if((n = read(fd, p, e-p)) < 0) + if((n = read(fd, p, e-p)) <= 0) break; e = p + n; while(p < e && fullrune(p, e - p)){ @@ -1243,10 +1243,9 @@ kbdproc(void *arg) } } n = e - p; - if(n > 0){ + if(n > 0) memmove(buf, p, n); - p = buf + n; - } + p = buf + n; } close(fd); } |