aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tset/tset.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1994-09-09 02:39:24 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1994-09-09 02:39:24 +0000
commit28fccc17496286693b89a088778b59c0006eb6c1 (patch)
treef3e9eccdee5415f469eb17217c8bde466859a885 /usr.bin/tset/tset.c
parenta152929b021e172341604be43d60e6aefdab5f7e (diff)
Notes
Diffstat (limited to 'usr.bin/tset/tset.c')
-rw-r--r--usr.bin/tset/tset.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c
index 7198e96a1b33..3cc2a133b8a3 100644
--- a/usr.bin/tset/tset.c
+++ b/usr.bin/tset/tset.c
@@ -180,10 +180,15 @@ main(argc, argv)
tcsetattr(STDERR_FILENO, TCSADRAIN, &mode);
}
- /* Get the terminal name from the entry. */
- p = tcapbuf;
- if (p != NULL && *p != ':') {
- t = p;
+ /*
+ * The termcap file generally has a two-character name first in each
+ * entry followed by more descriptive names. If we ended up with the
+ * first one, we switch to the second one for setting or reporting
+ * information.
+ */
+ p = strpbrk(tcapbuf, "|:");
+ if (p != NULL && *p != ':' && !strncmp(ttype, tcapbuf, p - tcapbuf)) {
+ t = ++p;
if (p = strpbrk(p, "|:")) {
savech = *p;
*p = '\0';