lineedit: fix two bugs in SIGWINCH signal handling
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 27 Nov 2016 21:25:07 +0000 (22:25 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 27 Nov 2016 21:25:07 +0000 (22:25 +0100)
commitbff71d3b9d4244abc5182c38d0a98f4913188391
treecd881f8a0563b32ad537f0bcae455dab2aa1decb
parent710b6ce9b0dba1b13028e7205bade70eefc2543f
lineedit: fix two bugs in SIGWINCH signal handling

(1) restore entire sigaction, not only signal handler function
(2) do not use stdio when not sure WINCH did not interrupt a printf() or such.

function                                             old     new   delta
cmdedit_setwidth                                       -      81     +81
read_line_input                                     3682    3722     +40
lineedit_read_key                                    138     155     +17
put_prompt                                            55      51      -4
win_changed                                           93      47     -46
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/2 up/down: 138/-50)            Total: 88 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/lineedit.c