Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/tset Make emitting the full termcap entry an option ...



details:   https://anonhg.NetBSD.org/src/rev/5de74e157f23
branches:  trunk
changeset: 486946:5de74e157f23
user:      blymn <blymn%NetBSD.org@localhost>
date:      Wed May 31 05:50:05 2000 +0000

description:
Make emitting the full termcap entry an option otherwise csh breaks.

diffstat:

 usr.bin/tset/extern.h |   4 ++--
 usr.bin/tset/term.c   |  11 ++++++-----
 usr.bin/tset/tset.1   |  11 ++++++++---
 usr.bin/tset/tset.c   |  16 ++++++++++------
 4 files changed, 26 insertions(+), 16 deletions(-)

diffs (158 lines):

diff -r 9a46416a3d73 -r 5de74e157f23 usr.bin/tset/extern.h
--- a/usr.bin/tset/extern.h     Wed May 31 05:28:26 2000 +0000
+++ b/usr.bin/tset/extern.h     Wed May 31 05:50:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.7 1999/10/04 23:33:24 lukem Exp $ */
+/*     $NetBSD: extern.h,v 1.8 2000/05/31 05:50:05 blymn Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -45,7 +45,7 @@
 
 void    add_mapping __P((const char *, char *));
 void    cat __P((char *));
-const   char *get_termcap_entry __P((const char *, char **));
+const   char *get_termcap_entry __P((const char *, char **, int));
 const   char *mapped __P((const char *));
 int     outc __P((int));
 void    reset_mode __P((void));
diff -r 9a46416a3d73 -r 5de74e157f23 usr.bin/tset/term.c
--- a/usr.bin/tset/term.c       Wed May 31 05:28:26 2000 +0000
+++ b/usr.bin/tset/term.c       Wed May 31 05:50:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: term.c,v 1.13 2000/05/25 12:53:55 blymn Exp $  */
+/*     $NetBSD: term.c,v 1.14 2000/05/31 05:50:06 blymn Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c     8.1 (Berkeley) 6/9/93";
 #endif
-__RCSID("$NetBSD: term.c,v 1.13 2000/05/25 12:53:55 blymn Exp $");
+__RCSID("$NetBSD: term.c,v 1.14 2000/05/31 05:50:06 blymn Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -62,9 +62,10 @@
  * its termcap entry.
  */
 const char *
-get_termcap_entry(userarg, tcapbufp)
+get_termcap_entry(userarg, tcapbufp, extended)
        const char *userarg;
        char **tcapbufp;
+       int extended;
 {
        struct ttyent *t;
        int rval;
@@ -134,10 +135,10 @@
        }
 
          /* check if we get a truncated termcap entry, fish back the full
-          * one if need be
+          * one if need be and the user has asked for it.
           */
        zz_ptr = zz;
-       if (tgetstr("ZZ", &zz_ptr) != NULL) {
+       if ((extended == 1) && (tgetstr("ZZ", &zz_ptr) != NULL)) {
                          /* it was, fish back the full termcap */
                sscanf(zz, "%p", &ext_tc);
                if ((newptr = (char *) realloc(tbuf, strlen(ext_tc) + 1))
diff -r 9a46416a3d73 -r 5de74e157f23 usr.bin/tset/tset.1
--- a/usr.bin/tset/tset.1       Wed May 31 05:28:26 2000 +0000
+++ b/usr.bin/tset/tset.1       Wed May 31 05:50:05 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: tset.1,v 1.9 1999/03/22 18:16:45 garbled Exp $
+.\"    $NetBSD: tset.1,v 1.10 2000/05/31 05:50:06 blymn Exp $
 .\"
 .\" Copyright (c) 1985, 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -42,7 +42,7 @@
 .Nd terminal initialization
 .Sh SYNOPSIS
 .Nm
-.Op Fl IQrSs
+.Op Fl EIQrSs
 .Op Fl
 .Op Fl e Ar ch
 .Op Fl i Ar ch
@@ -51,7 +51,7 @@
 .Op Ar terminal
 .br
 .Nm reset
-.Op Fl IQrSs
+.Op Fl EIQrSs
 .Op Fl
 .Op Fl e Ar ch
 .Op Fl i Ar ch
@@ -123,6 +123,11 @@
 .It Fl e
 Set the erase character to
 .Ar ch .
+.It Fl E
+Emit the extended termcap entry.  By default the termcap entry is
+truncated to 1024 bytes, this flag specifies the untruncated termcap
+entry is to be output.  Using this flag may cause problems with some
+shells.
 .It Fl I
 Do not send the terminal or tab initialization strings to the terminal.
 .It Fl i
diff -r 9a46416a3d73 -r 5de74e157f23 usr.bin/tset/tset.c
--- a/usr.bin/tset/tset.c       Wed May 31 05:28:26 2000 +0000
+++ b/usr.bin/tset/tset.c       Wed May 31 05:50:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tset.c,v 1.9 1999/12/20 14:36:11 kleink Exp $  */
+/*     $NetBSD: tset.c,v 1.10 2000/05/31 05:50:06 blymn Exp $  */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)tset.c     8.1 (Berkeley) 6/9/93";
 #endif
-__RCSID("$NetBSD: tset.c,v 1.9 1999/12/20 14:36:11 kleink Exp $");
+__RCSID("$NetBSD: tset.c,v 1.10 2000/05/31 05:50:06 blymn Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -80,7 +80,8 @@
 #ifdef TIOCGWINSZ
        struct winsize win;
 #endif
-       int ch, noinit, noset, quiet, Sflag, sflag, showterm, usingupper;
+       int ch, extended, noinit, noset, quiet, Sflag, sflag, showterm;
+       int usingupper;
        char savech, *p, *t, *tcapbuf;
        const char *ttype;
 
@@ -101,8 +102,8 @@
        }
 
        obsolete(argv);
-       noinit = noset = quiet = Sflag = sflag = showterm = 0;
-       while ((ch = getopt(argc, argv, "-a:d:e:Ii:k:m:np:QSrs")) != -1) {
+       noinit = noset = quiet = Sflag = sflag = showterm = extended = 0;
+       while ((ch = getopt(argc, argv, "-a:d:e:EIi:k:m:np:QSrs")) != -1) {
                switch (ch) {
                case '-':               /* display term only */
                        noset = 1;
@@ -118,6 +119,9 @@
                            optarg[1] == '?' ? '\177' : CTRL(optarg[1]) :
                            optarg[0];
                        break;
+               case 'E':
+                       extended = 1;
+                       break;
                case 'I':               /* no initialization strings */
                        noinit = 1;
                        break;
@@ -162,7 +166,7 @@
        if (argc > 1)
                usage();
 
-       ttype = get_termcap_entry(*argv, &tcapbuf);
+       ttype = get_termcap_entry(*argv, &tcapbuf, extended);
 
        if (!noset) {
                columns = tgetnum("co");



Home | Main Index | Thread Index | Old Index