svn commit: r411985 - in head/devel/libedit: . files
Baptiste Daroussin
bapt at FreeBSD.org
Sun Mar 27 10:10:06 UTC 2016
Author: bapt
Date: Sun Mar 27 10:10:05 2016
New Revision: 411985
URL: https://svnweb.freebsd.org/changeset/ports/411985
Log:
Apply upstream patch to avoid tty corruption in case of output to a pipe.
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50863
PR: 208320
Submitted by: John Hein <z7dr6ut7gs at snkmail.com>
Added:
head/devel/libedit/files/patch-netbsd-pr-50863 (contents, props changed)
Modified:
head/devel/libedit/Makefile
Modified: head/devel/libedit/Makefile
==============================================================================
--- head/devel/libedit/Makefile Sun Mar 27 09:11:15 2016 (r411984)
+++ head/devel/libedit/Makefile Sun Mar 27 10:10:05 2016 (r411985)
@@ -4,7 +4,7 @@
PORTNAME= libedit
PORTVERSION= ${EDITVERSION}.${EDITDATE}
DISTVERSION= ${EDITDATE}-${EDITVERSION}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= http://thrysoee.dk/editline/
Added: head/devel/libedit/files/patch-netbsd-pr-50863
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/devel/libedit/files/patch-netbsd-pr-50863 Sun Mar 27 10:10:05 2016 (r411985)
@@ -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;
+
+
More information about the svn-ports-head
mailing list