From 00c43e0ca43cbae7daacb5d0931028045fb45e51 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Wed, 11 Jul 2012 22:17:58 +0000 Subject: [PATCH] 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 --- bin/sh/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)