summaryrefslogtreecommitdiffstats
path: root/usr.bin/tset
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-09 02:39:24 +0000
committerache <ache@FreeBSD.org>1994-09-09 02:39:24 +0000
commitaebfcd0c1d6de92964d9bb3f80cc98c5e66f1d84 (patch)
treef3e9eccdee5415f469eb17217c8bde466859a885 /usr.bin/tset
parent9a1d8f93a1948fc4e35f9b88b64ef0503c643498 (diff)
downloadFreeBSD-src-aebfcd0c1d6de92964d9bb3f80cc98c5e66f1d84.zip
FreeBSD-src-aebfcd0c1d6de92964d9bb3f80cc98c5e66f1d84.tar.gz
Use second terminal name instead of obsoleted and duplicated
first two-letter names (from 1.1.5.1)
Diffstat (limited to 'usr.bin/tset')
-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 7198e96..3cc2a13 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';
OpenPOWER on IntegriCloud