summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2012-07-11 22:17:58 +0000
committerpfg <pfg@FreeBSD.org>2012-07-11 22:17:58 +0000
commit676e6cd9af77f9583b012de4cc5037a3e7fd503e (patch)
tree079b55a910d2d7c6fbc09bfaa58c5820c2c98c43 /bin
parent515d0c1d290c1ac2fb1aa99e74ef4175c158a007 (diff)
downloadFreeBSD-src-676e6cd9af77f9583b012de4cc5037a3e7fd503e.zip
FreeBSD-src-676e6cd9af77f9583b012de4cc5037a3e7fd503e.tar.gz
Merge libedit adjustment from NetBSD.
On recent versions of NetBSD's libedit, el_gets now sets el_len to -1 on error so we can distinguish between a NULL string and an error. This fixes sh from exiting with newer versions of libedit now allowing EINTR to return. Obtained from: NetBSD Reviewed by: jilles MFC after: 3 weeks
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c
index 3ceaea4..12f285f 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)
OpenPOWER on IntegriCloud