From: havill Date: Thu, 8 Apr 2004 18:48:14 +0000 (+0000) Subject: exit if newt is spinning while killed patch X-Git-Tag: r0-52-0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=417476937a64aee6233a7bf9fd454e31bebb3364;p=thirdparty%2Fnewt.git exit if newt is spinning while killed patch --- diff --git a/newt.c b/newt.c index cd44f5f..4cc22d0 100644 --- a/newt.c +++ b/newt.c @@ -367,7 +367,13 @@ int newtGetKey(void) { do { key = getkey(); - if (key == 0xFFFF) { + if (key == SLANG_GETKEY_ERROR) { + /* Either garbage was read, or stdin disappeared + * (the parent terminal was proably closed) + * if the latter, die. + */ + if (feof(stdin)) + exit(1); if (needResize) { needResize = 0; return NEWT_KEY_RESIZE;