From 72da2ef9ffb49a1fc550ec91caa1468e285f87e0 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Mon, 14 Nov 2016 11:16:03 -0700 Subject: cli: Fix ast_el_read_char to work with libedit >= 3.1 Libedit 3.1 is not build with unicode on as a default and so the prototype for the el_gets callback changed from expecting a char buffer to accepting a wchar buffer. If ast_el_read_char isn't changed, the cli reads garbage from teh terminal. Added a configure test for (*el_rfunc_t)(EditLine *, wchar_t *) and updated ast_el_read_char to use the HAVE_ define to detemrine whether to use char or wchar. ASTERISK-26592 #close Change-Id: I9099b46f68e06d0202ff80e53022a2b68b08871a --- configure.ac | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ea55df416..7261e535c 100644 --- a/configure.ac +++ b/configure.ac @@ -479,6 +479,7 @@ AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue]) AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap]) AST_LIBCURL_CHECK_CONFIG([], [7.10.1]) AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit], [, use 'internal' Editline otherwise]) +AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], [LIBEDIT], [libedit]) AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2]) AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt]) AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt]) @@ -1530,11 +1531,14 @@ if test "${USE_LIBEDIT}" != "no"; then if test "${LIBEDIT_SYSTEM}" = "yes"; then AST_PKG_CONFIG_CHECK(LIBEDIT, libedit) if test "$PBX_LIBEDIT" = "1"; then - LIBEDIT_INTERNAL="no" + LIBEDIT_INTERNAL="no" fi fi if test "${LIBEDIT_INTERNAL}" = "yes"; then PBX_LIBEDIT=1 + LIBEDIT_IS_UNICODE=no + else + AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support]) fi fi -- cgit v1.2.3