diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2019-09-10 13:55:44 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2019-09-10 13:55:44 +0000 |
commit | 3150625201d9c293e5c34b19b8a2d48a27da5f07 (patch) | |
tree | 4b83d615adb9f3870c56fd4e3caf62956df0f12c /read.c | |
parent | 8c36b0434ca4a5ba6df2724542048eb219af7a34 (diff) | |
download | src-test2-vendor/NetBSD/libedit/2019-09-10.tar.gz src-test2-vendor/NetBSD/libedit/2019-09-10.zip |
Update libedit to snapshot 2019-09-10vendor/NetBSD/libedit/2019-09-10vendor/NetBSD/libedit
Diffstat (limited to 'read.c')
-rw-r--r-- | read.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: read.c,v 1.103 2017/06/27 23:24:19 christos Exp $ */ +/* $NetBSD: read.c,v 1.106 2019/07/23 10:18:52 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.103 2017/06/27 23:24:19 christos Exp $"); +__RCSID("$NetBSD: read.c,v 1.106 2019/07/23 10:18:52 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -89,8 +89,7 @@ read_init(EditLine *el) return -1; ma = &el->el_read->macros; - if ((ma->macro = el_malloc(EL_MAXMACRO * - sizeof(*ma->macro))) == NULL) { + if ((ma->macro = el_calloc(EL_MAXMACRO, sizeof(*ma->macro))) == NULL) { free(el->el_read); return -1; } @@ -335,13 +334,7 @@ read_char(EditLine *el, wchar_t *cp) goto again; } case (size_t)-2: - /* - * We don't support other multibyte charsets. - * The second condition shouldn't happen - * and is here merely for additional safety. - */ - if ((el->el_flags & CHARSET_IS_UTF8) == 0 || - cbp >= MB_LEN_MAX) { + if (cbp >= MB_LEN_MAX) { errno = EILSEQ; *cp = L'\0'; return -1; |