]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
i9e: Fix braino in i9e_post_select().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 25 Jul 2022 21:20:11 +0000 (23:20 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 21 Aug 2022 15:12:55 +0000 (17:12 +0200)
Due to this bug we mishandled the case where the read() returns zero
to indicate EOF. In this case we stuffed a random character instead
of shutting down the i9e task.

interactive.c

index a8197308e8323c8fe78546117cc2e9479df0fbfd..4819e1c737032bdc62de06a40f351263734e0911 100644 (file)
@@ -320,9 +320,10 @@ static int i9e_post_select(__a_unused struct sched *s, __a_unused void *context)
                                ret = -ERRNO_TO_PARA_ERROR(errno);
                                goto rm_btrn;
                        }
-                       ret = -E_I9E_EOF;
-                       if (ret == 0)
+                       if (ret == 0) {
+                               ret = -E_I9E_EOF;
                                goto rm_btrn;
+                       }
                        buf[1] = '\0';
                        i9ep->key_sequence_length++;
                        rl_stuff_char((int)(unsigned char)*buf);