From: <abe...@us...> - 2016-12-05 18:35:38
|
Revision: 8017 http://sourceforge.net/p/astlinux/code/8017 Author: abelbeck Date: 2016-12-05 18:35:36 +0000 (Mon, 05 Dec 2016) Log Message: ----------- asterisk, backport 13.13.0 patch to allow the newer utf-8 enabled libedit to work in the CLI. This allows asterisk to share the newer version of libedit and makes the asterisk binary 100 KB smaller Modified Paths: -------------- branches/1.0/package/asterisk/asterisk.mk Added Paths: ----------- branches/1.0/package/asterisk/asterisk-11-cli-libedit-utf8.patch branches/1.0/package/asterisk/asterisk-13-cli-libedit-utf8.patch Added: branches/1.0/package/asterisk/asterisk-11-cli-libedit-utf8.patch =================================================================== --- branches/1.0/package/asterisk/asterisk-11-cli-libedit-utf8.patch (rev 0) +++ branches/1.0/package/asterisk/asterisk-11-cli-libedit-utf8.patch 2016-12-05 18:35:36 UTC (rev 8017) @@ -0,0 +1,63 @@ +X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=main%2Fasterisk.c;h=fa919936b4767580ff852f2ba1fcbe7781949968;hp=1c7a0e1885501e5e2446c72266e492ffd40a08ef;hb=5e0c22404316ecdf8e1510553474274eddf55e20;hpb=ec17e96784b8a75f74d84621165c73d986d56f95 + +diff --git a/main/asterisk.c b/main/asterisk.c +index 1c7a0e1..fa91993 100644 +--- a/main/asterisk.c ++++ b/main/asterisk.c +@@ -2568,7 +2568,13 @@ static void send_rasterisk_connect_commands(void) + } + } + ++#define HAVE_LIBEDIT_IS_UNICODE 1 ++ ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++static int ast_el_read_char(EditLine *editline, wchar_t *cp) ++#else + static int ast_el_read_char(EditLine *editline, char *cp) ++#endif + { + int num_read = 0; + int lastpos = 0; +@@ -2598,10 +2604,16 @@ static int ast_el_read_char(EditLine *editline, char *cp) + } + + if (!ast_opt_exec && fds[1].revents) { +- num_read = read(STDIN_FILENO, cp, 1); ++ char c = '\0'; ++ num_read = read(STDIN_FILENO, &c, 1); + if (num_read < 1) { + break; + } else { ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++ *cp = btowc(c); ++#else ++ *cp = c; ++#endif + return (num_read); + } + } +@@ -2645,7 +2657,11 @@ static int ast_el_read_char(EditLine *editline, char *cp) + console_print(buf, 0); + + if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (res >= 2 && buf[res-2] == '\n'))) { ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++ *cp = btowc(CC_REFRESH); ++#else + *cp = CC_REFRESH; ++#endif + return(1); + } else { + lastpos = 1; +@@ -2653,7 +2669,12 @@ static int ast_el_read_char(EditLine *editline, char *cp) + } + } + ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++ *cp = btowc('\0'); ++#else + *cp = '\0'; ++#endif ++ + return (0); + } + Added: branches/1.0/package/asterisk/asterisk-13-cli-libedit-utf8.patch =================================================================== --- branches/1.0/package/asterisk/asterisk-13-cli-libedit-utf8.patch (rev 0) +++ branches/1.0/package/asterisk/asterisk-13-cli-libedit-utf8.patch 2016-12-05 18:35:36 UTC (rev 8017) @@ -0,0 +1,63 @@ +X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=main%2Fasterisk.c;h=fa919936b4767580ff852f2ba1fcbe7781949968;hp=1c7a0e1885501e5e2446c72266e492ffd40a08ef;hb=5e0c22404316ecdf8e1510553474274eddf55e20;hpb=ec17e96784b8a75f74d84621165c73d986d56f95 + +diff --git a/main/asterisk.c b/main/asterisk.c +index 1c7a0e1..fa91993 100644 +--- a/main/asterisk.c ++++ b/main/asterisk.c +@@ -2818,7 +2818,13 @@ static void send_rasterisk_connect_commands(void) + } + } + ++#define HAVE_LIBEDIT_IS_UNICODE 1 ++ ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++static int ast_el_read_char(EditLine *editline, wchar_t *cp) ++#else + static int ast_el_read_char(EditLine *editline, char *cp) ++#endif + { + int num_read = 0; + int lastpos = 0; +@@ -2848,10 +2854,16 @@ static int ast_el_read_char(EditLine *editline, char *cp) + } + + if (!ast_opt_exec && fds[1].revents) { +- num_read = read(STDIN_FILENO, cp, 1); ++ char c = '\0'; ++ num_read = read(STDIN_FILENO, &c, 1); + if (num_read < 1) { + break; + } else { ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++ *cp = btowc(c); ++#else ++ *cp = c; ++#endif + return (num_read); + } + } +@@ -2895,7 +2907,11 @@ static int ast_el_read_char(EditLine *editline, char *cp) + console_print(buf, 0); + + if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (res >= 2 && buf[res-2] == '\n'))) { ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++ *cp = btowc(CC_REFRESH); ++#else + *cp = CC_REFRESH; ++#endif + return(1); + } else { + lastpos = 1; +@@ -2903,7 +2919,12 @@ static int ast_el_read_char(EditLine *editline, char *cp) + } + } + ++#ifdef HAVE_LIBEDIT_IS_UNICODE ++ *cp = btowc('\0'); ++#else + *cp = '\0'; ++#endif ++ + return (0); + } + Modified: branches/1.0/package/asterisk/asterisk.mk =================================================================== --- branches/1.0/package/asterisk/asterisk.mk 2016-12-05 16:10:15 UTC (rev 8016) +++ branches/1.0/package/asterisk/asterisk.mk 2016-12-05 18:35:36 UTC (rev 8017) @@ -52,9 +52,14 @@ ASTERISK_CONFIGURE_ARGS+= \ --without-cap -# Asterisk does not work using system libedit with wide-char/UTF-8 support +ifeq ($(strip $(BR2_PACKAGE_LIBEDIT)),y) +ASTERISK_EXTRAS+=libedit ASTERISK_CONFIGURE_ARGS+= \ + --with-libedit="$(STAGING_DIR)/usr" +else +ASTERISK_CONFIGURE_ARGS+= \ --without-libedit +endif ifeq ($(strip $(BR2_PACKAGE_LIBXML2)),y) ASTERISK_EXTRAS+=libxml2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |