Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2015 07:51:31 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r376581 - head/devel/libedit/files
Message-ID:  <201501090751.t097pVtB006138@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Fri Jan  9 07:51:30 2015
New Revision: 376581
URL: https://svnweb.freebsd.org/changeset/ports/376581
QAT: https://qat.redports.org/buildarchive/r376581/

Log:
  Fix the number of element returned with el_getc in unicode env

Modified:
  head/devel/libedit/files/patch-src_eln.c

Modified: head/devel/libedit/files/patch-src_eln.c
==============================================================================
--- head/devel/libedit/files/patch-src_eln.c	Fri Jan  9 06:46:08 2015	(r376580)
+++ head/devel/libedit/files/patch-src_eln.c	Fri Jan  9 07:51:30 2015	(r376581)
@@ -1,16 +1,24 @@
---- src/eln.c.orig	2015-01-07 22:26:24 UTC
-+++ src/eln.c
-@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread)
+--- src/eln.c.orig	2014-06-18 21:06:34.000000000 +0200
++++ src/eln.c	2015-01-09 08:48:42.000000000 +0100
+@@ -75,10 +75,18 @@ public const char *
+ el_gets(EditLine *el, int *nread)
  {
  	const wchar_t *tmp;
- 
--	el->el_flags |= IGNORE_EXTCHARS;
++	int nwread;
++
++	*nread = 0;
++
 +	if (!(el->el_flags & CHARSET_IS_UTF8))
 +		el->el_flags |= IGNORE_EXTCHARS;
- 	tmp = el_wgets(el, nread);
--	el->el_flags &= ~IGNORE_EXTCHARS;
++	tmp = el_wgets(el, &nwread);
 +	if (!(el->el_flags & CHARSET_IS_UTF8))
 +		el->el_flags &= ~IGNORE_EXTCHARS;
++	for (int i = 0; i < nwread; i++)
++		*nread += ct_enc_width(tmp[i]);
+ 
+-	el->el_flags |= IGNORE_EXTCHARS;
+-	tmp = el_wgets(el, nread);
+-	el->el_flags &= ~IGNORE_EXTCHARS;
  	return ct_encode_string(tmp, &el->el_lgcyconv);
  }
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501090751.t097pVtB006138>