Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit Separate tty separation from the prompt printing...



details:   https://anonhg.NetBSD.org/src/rev/8a3342814dcf
branches:  trunk
changeset: 558667:8a3342814dcf
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 21 16:42:30 2004 +0000

description:
Separate tty separation from the prompt printing function. From Gerry Swislow.

diffstat:

 lib/libedit/el.c   |   6 +++---
 lib/libedit/read.c |  14 +++++++++++---
 lib/libedit/read.h |   3 ++-
 3 files changed, 16 insertions(+), 7 deletions(-)

diffs (86 lines):

diff -r c7f9b56569e5 -r 8a3342814dcf lib/libedit/el.c
--- a/lib/libedit/el.c  Sat Feb 21 16:02:06 2004 +0000
+++ b/lib/libedit/el.c  Sat Feb 21 16:42:30 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: el.c,v 1.36 2003/10/18 23:48:42 christos Exp $ */
+/*     $NetBSD: el.c,v 1.37 2004/02/21 16:42:30 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c       8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.36 2003/10/18 23:48:42 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.37 2004/02/21 16:42:30 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -271,7 +271,7 @@
        case EL_PREP_TERM:
                rv = va_arg(va, int);
                if (rv)
-                       read_prepare(el);
+                       read_prepare_tty(el);
                else
                        read_finish(el);
                rv = 0;
diff -r c7f9b56569e5 -r 8a3342814dcf lib/libedit/read.c
--- a/lib/libedit/read.c        Sat Feb 21 16:02:06 2004 +0000
+++ b/lib/libedit/read.c        Sat Feb 21 16:42:30 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: read.c,v 1.31 2004/01/17 17:57:40 christos Exp $       */
+/*     $NetBSD: read.c,v 1.32 2004/02/21 16:42:30 christos Exp $       */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)read.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: read.c,v 1.31 2004/01/17 17:57:40 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.32 2004/02/21 16:42:30 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -351,7 +351,7 @@
 }
 
 protected void
-read_prepare(EditLine *el)
+read_prepare_tty(EditLine *el)
 {
        if (el->el_flags & HANDLE_SIGNALS)
                sig_set(el);
@@ -359,6 +359,14 @@
                return;
        if ((el->el_flags & (UNBUFFERED|EDIT_DISABLED)) == UNBUFFERED)
                tty_rawmode(el);
+}
+
+protected void
+read_prepare(EditLine *el)
+{
+       read_prepare_tty(el);
+       if (el->el_flags & NO_TTY)
+               return;
 
        /* This is relatively cheap, and things go terribly wrong if
           we have the wrong size. */
diff -r c7f9b56569e5 -r 8a3342814dcf lib/libedit/read.h
--- a/lib/libedit/read.h        Sat Feb 21 16:02:06 2004 +0000
+++ b/lib/libedit/read.h        Sat Feb 21 16:42:30 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: read.h,v 1.2 2003/09/26 17:44:51 christos Exp $        */
+/*     $NetBSD: read.h,v 1.3 2004/02/21 16:42:30 christos Exp $        */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@
 } el_read_t;
  
 protected int          read_init(EditLine *);
+protected void         read_prepare_tty(EditLine *);
 protected void         read_prepare(EditLine *);
 protected void         read_finish(EditLine *);
 protected int          el_read_setfn(EditLine *, el_rfunc_t);



Home | Main Index | Thread Index | Old Index