diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1994-09-09 02:39:24 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1994-09-09 02:39:24 +0000 |
| commit | 28fccc17496286693b89a088778b59c0006eb6c1 (patch) | |
| tree | f3e9eccdee5415f469eb17217c8bde466859a885 /usr.bin/tset/tset.c | |
| parent | a152929b021e172341604be43d60e6aefdab5f7e (diff) | |
Notes
Diffstat (limited to 'usr.bin/tset/tset.c')
| -rw-r--r-- | usr.bin/tset/tset.c | 13 |
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'; |
