fix broken kbdproc buffering
This commit is contained in:
parent
bb45ddca85
commit
07cfc31444
1 changed files with 3 additions and 4 deletions
|
@ -1232,7 +1232,7 @@ kbdproc(void *arg)
|
||||||
Rune r;
|
Rune r;
|
||||||
|
|
||||||
e = buf + sizeof(buf);
|
e = buf + sizeof(buf);
|
||||||
if((n = read(fd, p, e-p)) < 0)
|
if((n = read(fd, p, e-p)) <= 0)
|
||||||
break;
|
break;
|
||||||
e = p + n;
|
e = p + n;
|
||||||
while(p < e && fullrune(p, e - p)){
|
while(p < e && fullrune(p, e - p)){
|
||||||
|
@ -1243,11 +1243,10 @@ kbdproc(void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
n = e - p;
|
n = e - p;
|
||||||
if(n > 0){
|
if(n > 0)
|
||||||
memmove(buf, p, n);
|
memmove(buf, p, n);
|
||||||
p = buf + n;
|
p = buf + n;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
close(cfd);
|
close(cfd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue