From 9f3bd789f592cea0f446ef060cbb6aaeac2565e3 Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sun, 15 Jul 2012 01:10:09 -0700 Subject: [PATCH] sh: Fix sh from exiting with newer versions of libedit Obtained-from: FreeBSD 238377 --- bin/sh/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/sh/input.c b/bin/sh/input.c index 3c5df61557..41399882e5 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)input.c 8.3 (Berkeley) 6/9/95 - * $FreeBSD: src/bin/sh/input.c,v 1.35 2012/01/14 22:46:18 jilles Exp $ + * $FreeBSD: src/bin/sh/input.c,v 1.36 2012/07/11 22:17:58 pfg Exp $ */ #include /* defines BUFSIZ */ @@ -184,7 +184,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) -- 2.11.4.GIT