svn commit: r239542 - stable/9/bin/sh

Pedro F. Giffuni pfg at FreeBSD.org
Tue Aug 21 21:46:02 UTC 2012


Author: pfg
Date: Tue Aug 21 21:46:01 2012
New Revision: 239542
URL: http://svn.freebsd.org/changeset/base/239542

Log:
  MFC	r238377:
  
  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

Modified:
  stable/9/bin/sh/input.c
Directory Properties:
  stable/9/bin/sh/   (props changed)

Modified: stable/9/bin/sh/input.c
==============================================================================
--- stable/9/bin/sh/input.c	Tue Aug 21 21:21:51 2012	(r239541)
+++ stable/9/bin/sh/input.c	Tue Aug 21 21:46:01 2012	(r239542)
@@ -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 - 1)


More information about the svn-src-stable-9 mailing list