diff options
author | mp <mp@FreeBSD.org> | 2001-07-28 22:40:10 +0000 |
---|---|---|
committer | mp <mp@FreeBSD.org> | 2001-07-28 22:40:10 +0000 |
commit | b9208b18d5d6f747062fbda0a70c27212711ab0a (patch) | |
tree | 3d6b6c232445c251749831e330c54e6e28c24cf7 /usr.bin | |
parent | 815cafd7d003ae1cb5ded9f15c5bdf81040a3582 (diff) | |
download | FreeBSD-src-b9208b18d5d6f747062fbda0a70c27212711ab0a.zip FreeBSD-src-b9208b18d5d6f747062fbda0a70c27212711ab0a.tar.gz |
Properly handle wgetch(3) returning ERR. This prevents an abnormal exit
when a windows resize event (SIGWINCH) occurs.
Reported by: John Doe <rhamming2001@yahoo.com> and others on -stable.
Reviewed by: dd
MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ee/ee.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c index 475e9e8..effdf14 100644 --- a/usr.bin/ee/ee.c +++ b/usr.bin/ee/ee.c @@ -630,7 +630,7 @@ char *argv[]; doupdate(); in = wgetch(text_win); if (in == -1) - exit(0); + continue; resize_check(); @@ -1877,7 +1877,7 @@ int advance; /* if true, skip leading spaces and tabs */ esc_flag = FALSE; in = wgetch(com_win); if (in == -1) - exit(0); + continue; if (((in == 8) || (in == 127) || (in == KEY_BACKSPACE)) && (g_pos > 0)) { tmp_int = g_horz; @@ -1902,7 +1902,7 @@ int advance; /* if true, skip leading spaces and tabs */ esc_flag = TRUE; in = wgetch(com_win); if (in == -1) - exit(0); + continue; } *nam_str = in; g_pos++; @@ -3382,10 +3382,7 @@ struct menu_entries menu_list[]; wmove(temp_win, (counter + top_offset - off_start), 3); wrefresh(temp_win); - in = wgetch(temp_win); - input = in; - if (input == -1) - exit(0); + input = wgetch(temp_win); if (((tolower(input) >= 'a') && (tolower(input) <= 'z')) || ((input >= '0') && (input <= '9'))) @@ -3628,8 +3625,6 @@ help() wprintw(com_win, press_any_key_msg); wrefresh(com_win); counter = wgetch(com_win); - if (counter == -1) - exit(0); werase(com_win); wmove(com_win, 0, 0); werase(help_win); |