]> git.droids-corp.org - libcmdline.git/commitdiff
cmdline: break the interact loop if it returns EOF
authorOlivier Matz <zer0@droids-corp.org>
Thu, 27 Oct 2011 20:45:02 +0000 (22:45 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 27 Oct 2011 20:46:56 +0000 (22:46 +0200)
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
src/lib/cmdline.c

index 70267de19b1af9537a2c2f8714855a0251e4d86d..b0fee321dab0ab4df30b1e405bc7b452cbcea1a0 100644 (file)
@@ -225,7 +225,7 @@ cmdline_interact(struct cmdline *cl)
 
        c = -1;
        while (1) {
-               if (read(cl->s_in, &c, 1) < 0)
+               if (read(cl->s_in, &c, 1) <= 0)
                        break;
                if (cmdline_in(cl, &c, 1) < 0)
                        break;