]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
exit if newt is spinning while killed patch
authorhavill <havill>
Thu, 8 Apr 2004 18:48:14 +0000 (18:48 +0000)
committerhavill <havill>
Thu, 8 Apr 2004 18:48:14 +0000 (18:48 +0000)
newt.c

diff --git a/newt.c b/newt.c
index cd44f5f978a4d17fd70a393f1061324b0b938408..4cc22d0507eca8084136aacbe7f3213e4af45f11 100644 (file)
--- 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;