diff options
author | tjr <tjr@FreeBSD.org> | 2002-07-24 02:06:07 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-07-24 02:06:07 +0000 |
commit | 9c6ea7014edab1af5e2d1d262e39b740fd40312e (patch) | |
tree | 944ac64c9147450388579c5d5667cd68f728aeff /bin/sh/input.c | |
parent | 9ece963548fc032edefe665b4c0831dae7414292 (diff) | |
download | FreeBSD-src-9c6ea7014edab1af5e2d1d262e39b740fd40312e.zip FreeBSD-src-9c6ea7014edab1af5e2d1d262e39b740fd40312e.tar.gz |
Avoid calling el_resize() from a signal handler, even though libedit
itself does that if you set EL_SIGNAL. Instead, set a flag and check it
before calling el_gets(). This is safer, but slower to respond to changes.
Pointed out by: mp
Diffstat (limited to 'bin/sh/input.c')
-rw-r--r-- | bin/sh/input.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c index 9f8df53..47c7283 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include "alias.h" #include "parser.h" #include "myhistedit.h" +#include "trap.h" #define EOF_NLEFT -99 /* value of parsenleft when EOF pushed back */ @@ -178,6 +179,12 @@ preadfd(void) int nr; parsenextc = parsefile->buf; +#ifndef NO_HISTORY + if (el != NULL && gotwinch) { + gotwinch = 0; + el_resize(el); + } +#endif retry: #ifndef NO_HISTORY if (parsefile->fd == 0 && el) { |