summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-05-13 03:27:25 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-05-13 03:27:25 +0000
commit07cfc314441839d75e2ef8420a246f3dcbc517b4 (patch)
tree47e0f98c50e340d5bed7f292d1ac186c86facfbe
parentbb45ddca85109a945c8293c180febd534d35b0fb (diff)
downloadplan9front-07cfc314441839d75e2ef8420a246f3dcbc517b4.tar.xz
fix broken kbdproc buffering
-rw-r--r--sys/src/cmd/rio/rio.c7
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);
}