summaryrefslogtreecommitdiff
path: root/lib/libedit/read.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2016-02-24 17:20:01 +0000
committerchristos <christos@NetBSD.org>2016-02-24 17:20:01 +0000
commit2918e3cf14d032cebc8190313e4be22aa37f0c73 (patch)
tree9649ccfa7f171d7b69e3027e44868a8fe24266c2 /lib/libedit/read.c
parentb2b6a38fcd5e124dcdc5e366298c40502b957a3d (diff)
Tuck in mbstate_t to the wide char version only to avoid exposing the zeroing
hack and doing it in the narrow case.
Diffstat (limited to 'lib/libedit/read.c')
-rw-r--r--lib/libedit/read.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libedit/read.c b/lib/libedit/read.c
index 7b9a544dd9f..7b7805834d5 100644
--- a/lib/libedit/read.c
+++ b/lib/libedit/read.c
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.84 2016/02/24 17:13:22 christos Exp $ */
+/* $NetBSD: read.c,v 1.85 2016/02/24 17:20:01 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: read.c,v 1.84 2016/02/24 17:13:22 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.85 2016/02/24 17:20:01 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -343,12 +343,9 @@ read_char(EditLine *el, wchar_t *cp)
}
for (;;) {
- mbstate_t mbs;
++cbp;
- /* This only works because UTF8 is stateless */
- memset(&mbs, 0, sizeof(mbs));
- switch (ct_mbrtowc(cp, cbuf, cbp, &mbs)) {
+ switch (ct_mbrtowc(cp, cbuf, cbp)) {
case (size_t)-1:
if (cbp > 1) {
/*