diff options
Diffstat (limited to 'devel/libedit/files')
-rw-r--r-- | devel/libedit/files/patch-netbsd-pr-50863 | 53 | ||||
-rw-r--r-- | devel/libedit/files/patch-src__chartype.h | 10 | ||||
-rw-r--r-- | devel/libedit/files/patch-src_eln.c | 21 |
3 files changed, 79 insertions, 5 deletions
diff --git a/devel/libedit/files/patch-netbsd-pr-50863 b/devel/libedit/files/patch-netbsd-pr-50863 new file mode 100644 index 000000000000..72383f9c2b12 --- /dev/null +++ b/devel/libedit/files/patch-netbsd-pr-50863 @@ -0,0 +1,53 @@ +http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50863 + +--- src/tty.c.orig 2014-06-18 19:07:45 UTC ++++ src/tty.c +@@ -499,6 +499,9 @@ tty_setup(EditLine *el) + if (el->el_flags & EDIT_DISABLED) + return 0; + ++ if (el->el_tty.t_initialized) ++ return -1; ++ + if (!isatty(el->el_outfd)) { + #ifdef DEBUG_TTY + (void) fprintf(el->el_errfile, "%s: isatty: %s\n", __func__, +@@ -558,6 +561,7 @@ tty_setup(EditLine *el) + + tty__setchar(&el->el_tty.t_ed, el->el_tty.t_c[ED_IO]); + tty_bind_char(el, 1); ++ el->el_tty.t_initialized = 1; + return 0; + } + +@@ -567,6 +571,7 @@ tty_init(EditLine *el) + + el->el_tty.t_mode = EX_IO; + el->el_tty.t_vdisable = _POSIX_VDISABLE; ++ el->el_tty.t_initialized = 0; + (void) memcpy(el->el_tty.t_t, ttyperm, sizeof(ttyperm_t)); + (void) memcpy(el->el_tty.t_c, ttychar, sizeof(ttychar_t)); + return tty_setup(el); +@@ -580,6 +585,9 @@ protected void + /*ARGSUSED*/ + tty_end(EditLine *el) + { ++ if (!el->el_tty.t_initialized) ++ return; ++ + if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) { + #ifdef DEBUG_TTY + (void) fprintf(el->el_errfile, +--- src/tty.h.orig 2014-06-18 16:05:56 UTC ++++ src/tty.h +@@ -474,8 +474,9 @@ typedef struct { + int t_tabs; + int t_eight; + speed_t t_speed; +- int t_mode; ++ unsigned char t_mode; + unsigned char t_vdisable; ++ unsigned char t_initialized; + } el_tty_t; + + diff --git a/devel/libedit/files/patch-src__chartype.h b/devel/libedit/files/patch-src__chartype.h index df5484047c9d..bfc24ed65fab 100644 --- a/devel/libedit/files/patch-src__chartype.h +++ b/devel/libedit/files/patch-src__chartype.h @@ -1,11 +1,11 @@ ---- src/chartype.h.orig 2016-06-10 20:04:58 UTC -+++ src/chartype.h -@@ -33,7 +33,7 @@ +--- src/chartype.h.orig 2015-03-25 21:02:28.000000000 +0100 ++++ src/chartype.h 2015-03-28 11:37:42.072100000 +0100 +@@ -44,7 +44,7 @@ * supports non-BMP code points without requiring UTF-16, but nothing * seems to actually advertise this properly, despite Unicode 3.1 having * been around since 2001... */ --#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) -+#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) +-#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) ++#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) #ifndef __STDC_ISO_10646__ /* In many places it is assumed that the first 127 code points are ASCII * compatible, so ensure wchar_t indeed does ISO 10646 and not some other diff --git a/devel/libedit/files/patch-src_eln.c b/devel/libedit/files/patch-src_eln.c new file mode 100644 index 000000000000..3021c89d94a7 --- /dev/null +++ b/devel/libedit/files/patch-src_eln.c @@ -0,0 +1,21 @@ +--- src/eln.c.orig 2015-03-25 21:02:28.000000000 +0100 ++++ src/eln.c 2015-03-28 11:42:29.913925000 +0100 +@@ -75,12 +75,17 @@ public const char * + el_gets(EditLine *el, int *nread) + { + const wchar_t *tmp; ++ int nwread; ++ ++ *nread = 0; + + if (!(el->el_flags & CHARSET_IS_UTF8)) + el->el_flags |= IGNORE_EXTCHARS; +- tmp = el_wgets(el, nread); ++ tmp = el_wgets(el, &nwread); + if (!(el->el_flags & CHARSET_IS_UTF8)) + el->el_flags &= ~IGNORE_EXTCHARS; ++ for (int i = 0; i < nwread; i++) ++ *nread += ct_enc_width(tmp[i]); + return ct_encode_string(tmp, &el->el_lgcyconv); + } + |