diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-09-05 19:16:40 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-09-05 19:16:40 +0200 |
| commit | 9d858f5717cfc261d2ee80efff954acd7b1e5c00 (patch) | |
| tree | 39258fa1531360e9bcc65cdb49b25684e49e7783 /miscutils | |
| parent | 94aaf4b5d3c649a281299aedba08ce1939780fb4 (diff) | |
| download | busybox-w32-9d858f5717cfc261d2ee80efff954acd7b1e5c00.tar.gz busybox-w32-9d858f5717cfc261d2ee80efff954acd7b1e5c00.tar.bz2 busybox-w32-9d858f5717cfc261d2ee80efff954acd7b1e5c00.zip | |
chat: do not die when HANGUP param is missing. Closes 10016
function old new delta
chat_main 1356 1379 +23
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/chat.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/miscutils/chat.c b/miscutils/chat.c index 1446a040c..2dfe52c4f 100644 --- a/miscutils/chat.c +++ b/miscutils/chat.c | |||
| @@ -238,10 +238,18 @@ int chat_main(int argc UNUSED_PARAM, char **argv) | |||
| 238 | , *argv | 238 | , *argv |
| 239 | ); | 239 | ); |
| 240 | if (key >= 0) { | 240 | if (key >= 0) { |
| 241 | bool onoff; | ||
| 241 | // cache directive value | 242 | // cache directive value |
| 242 | char *arg = *++argv; | 243 | char *arg = *++argv; |
| 244 | |||
| 245 | if (!arg) { | ||
| 246 | #if ENABLE_FEATURE_CHAT_TTY_HIFI | ||
| 247 | tcsetattr(STDIN_FILENO, TCSAFLUSH, &tio0); | ||
| 248 | #endif | ||
| 249 | bb_show_usage(); | ||
| 250 | } | ||
| 243 | // OFF -> 0, anything else -> 1 | 251 | // OFF -> 0, anything else -> 1 |
| 244 | bool onoff = (0 != strcmp("OFF", arg)); | 252 | onoff = (0 != strcmp("OFF", arg)); |
| 245 | // process directive | 253 | // process directive |
| 246 | if (DIR_HANGUP == key) { | 254 | if (DIR_HANGUP == key) { |
| 247 | // turn SIGHUP on/off | 255 | // turn SIGHUP on/off |
