make client_test more robust in exiting if stdin is closed by caller

This commit is contained in:
arvidn 2018-11-25 17:39:22 +01:00 committed by Arvid Norberg
parent 778b132790
commit 3c29f6750a
1 changed files with 15 additions and 3 deletions

View File

@ -1356,7 +1356,11 @@ example alert_masks:
torrent_handle h = view.get_active_handle();
if (c == EOF) { break; }
if (c == EOF)
{
quit = true;
break;
}
do
{
if (c == escape_seq)
@ -1366,11 +1370,19 @@ example alert_masks:
int c2 = _getch();
#else
int c2 = getc(stdin);
if (c2 == EOF) { break; }
if (c2 == EOF)
{
quit = true;
break;
}
if (c2 != '[') continue;
c2 = getc(stdin);
#endif
if (c2 == EOF) break;
if (c2 == EOF)
{
quit = true;
break;
}
if (c2 == left_arrow)
{
int const filter = view.filter();