From 239472baec00ecfcdb7719fd7d7cda0f81fb41a7 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 22 Mar 2016 01:34:32 +0000 Subject: Fix reversed condition in tty_end() (Ingo Schwarze) Also don't succeed if calling setup twice. --- lib/libedit/tty.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c index 8d5ff873a11..5b9b7dd799d 100644 --- a/lib/libedit/tty.c +++ b/lib/libedit/tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.58 2016/02/27 18:13:21 christos Exp $ */ +/* $NetBSD: tty.c,v 1.59 2016/03/22 01:34:32 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: tty.c,v 1.58 2016/02/27 18:13:21 christos Exp $"); +__RCSID("$NetBSD: tty.c,v 1.59 2016/03/22 01:34:32 christos Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -498,10 +498,12 @@ tty_setup(EditLine *el) { int rst = 1; - el->el_tty.t_initialized = 0; 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__, @@ -571,6 +573,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); @@ -587,7 +590,7 @@ tty_end(EditLine *el) if (el->el_flags & EDIT_DISABLED) return; - if (el->el_tty.t_initialized) + if (!el->el_tty.t_initialized) return; if (tty_setty(el, TCSAFLUSH, &el->el_tty.t_or) == -1) { -- cgit s='right' method='get' action='/netbsd/log/external/bsd/fetch/lib'>
path: root/external/bsd/fetch/lib
AgeCommit message (Expand)Author
2020-06-01Avoid redefining _REENTRANT under sanitizerskamil
2020-02-08Expand the -Wno-macro-redefined usage to MKLIBCSANITIZERkamil
2019-10-13introduce some common variables for use in GCC warning disables:mrg
2019-10-10Only exclude ggc-8 warnings when the gcc we're using is gcc 8 or more.kre
2019-10-09No error for stringop truncation.christos
2019-08-27Enhance the support of LLVM sanitizerskamil
2018-02-04switch everyone to openssl.oldchristos
2017-05-21Remove MKCRYPTO option.riastradh
2016-01-05- Change LDADD/DPADD in library dependencies to LIBDPLIBSchristos
2011-08-17remove gcc hacks.christos
2011-08-09-Wno-array-bounds is no longer needed for clang herejoerg
2011-06-21add some XXX'd -Wno-foo if HAVE_GCC >= 45.mrg
2009-10-20Fix RCS IDjoerg
2009-07-20bump libcrypto and friends; OpenSSL abi change: do_cipher last argumentchristos
2009-07-20Use the correct libcrypto.christos
2009-05-28Allow building with MKCRYPTO=no.joerg
2009-01-11bump versions for time_tchristos
2008-11-25Use ${HOST_SH}, not ${SH}. ${SH} is undefined, so acts like anapb
2008-09-30Build glue for libfetch.joerg