diff --git a/bin/sh/input.c b/bin/sh/input.c index 3ceaea40e39f..12f285f8b423 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -186,7 +186,7 @@ retry: if (rl_cp == NULL) rl_cp = el_gets(el, &el_len); if (rl_cp == NULL) - nr = 0; + nr = el_len == 0 ? 0 : -1; else { nr = el_len; if (nr > BUFSIZ)