From cf8b244f11b03123342e8f16aa20614f1c19b922 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 7 Jan 2015 22:44:04 +0000 Subject: [PATCH] Fix Unicode environemnt detection Fix reading unicode lines More work is needed for part of the readline compatibility, this is good enough for the sqlite shell to accept unicode but not for ruby's irb yet --- devel/libedit/Makefile | 1 + devel/libedit/files/patch-src_el.c | 11 +++++++++++ devel/libedit/files/patch-src_eln.c | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 devel/libedit/files/patch-src_el.c create mode 100644 devel/libedit/files/patch-src_eln.c diff --git a/devel/libedit/Makefile b/devel/libedit/Makefile index 4aa151cb7d70..781da73794fb 100644 --- a/devel/libedit/Makefile +++ b/devel/libedit/Makefile @@ -4,6 +4,7 @@ PORTNAME= libedit PORTVERSION= ${EDITVERSION}.${EDITDATE} DISTVERSION= ${EDITDATE}-${EDITVERSION} +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://thrysoee.dk/editline/ diff --git a/devel/libedit/files/patch-src_el.c b/devel/libedit/files/patch-src_el.c new file mode 100644 index 000000000000..c84fdaa750f2 --- /dev/null +++ b/devel/libedit/files/patch-src_el.c @@ -0,0 +1,11 @@ +--- src/el.c.orig 2014-06-18 19:06:35 UTC ++++ src/el.c +@@ -121,7 +121,7 @@ el_init_fd(const char *prog, FILE *fin, + */ + el->el_flags = 0; + #ifdef WIDECHAR +- if (setlocale(LC_CTYPE, NULL) != NULL){ ++ if (setlocale(LC_CTYPE, "") != NULL){ + if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) + el->el_flags |= CHARSET_IS_UTF8; + } diff --git a/devel/libedit/files/patch-src_eln.c b/devel/libedit/files/patch-src_eln.c new file mode 100644 index 000000000000..96c826b1299f --- /dev/null +++ b/devel/libedit/files/patch-src_eln.c @@ -0,0 +1,16 @@ +--- src/eln.c.orig 2015-01-07 22:26:24 UTC ++++ src/eln.c +@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread) + { + const wchar_t *tmp; + +- el->el_flags |= IGNORE_EXTCHARS; ++ if (!(el->el_flags & CHARSET_IS_UTF8)) ++ el->el_flags |= IGNORE_EXTCHARS; + tmp = el_wgets(el, nread); +- el->el_flags &= ~IGNORE_EXTCHARS; ++ if (!(el->el_flags & CHARSET_IS_UTF8)) ++ el->el_flags &= ~IGNORE_EXTCHARS; + return ct_encode_string(tmp, &el->el_lgcyconv); + } +