artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07530f0
)
Don't write input if ICANON is enabled. Also, write one byte at a time.
author
anton
<anton@openbsd.org>
Sun, 18 Jun 2017 17:49:44 +0000
(17:49 +0000)
committer
anton
<anton@openbsd.org>
Sun, 18 Jun 2017 17:49:44 +0000
(17:49 +0000)
regress/bin/ksh/edit/edit.c
patch
|
blob
|
history
diff --git
a/regress/bin/ksh/edit/edit.c
b/regress/bin/ksh/edit/edit.c
index
0e707af
..
247e0b0
100644
(file)
--- a/
regress/bin/ksh/edit/edit.c
+++ b/
regress/bin/ksh/edit/edit.c
@@
-34,6
+34,7
@@
int
main(int argc, char *argv[])
{
char in[BUFSIZ], out[BUFSIZ];
+ struct termios tio;
struct pollfd pfd;
struct winsize ws;
pid_t pid;
@@
-100,7
+101,12
@@
main(int argc, char *argv[])
if (nread == 0)
continue;
- n = write(ptyfd, &in[nwrite], nin - nwrite);
+ if (tcgetattr(ptyfd, &tio) == -1)
+ err(1, "tcgetattr");
+ if ((tio.c_lflag & ICANON) == ICANON)
+ continue;
+
+ n = write(ptyfd, &in[nwrite], 1);
if (n == -1)
err(1, "write");
nwrite += n;