projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7729ff7
)
Tset incorrectly assign to TERM first terminal name instead of second
author
Andrey Chernov
<ache@FreeBSD.org>
Thu, 7 Apr 1994 01:38:30 +0000
(
01:38
+0000)
committer
Andrey Chernov
<ache@FreeBSD.org>
Thu, 7 Apr 1994 01:38:30 +0000
(
01:38
+0000)
from termcap entry.
usr.bin/tset/tset.c
patch
|
blob
|
blame
|
history
diff --git
a/usr.bin/tset/tset.c
b/usr.bin/tset/tset.c
index
4966b04
..
62745f0
100644
(file)
--- a/
usr.bin/tset/tset.c
+++ b/
usr.bin/tset/tset.c
@@
-180,10
+180,15
@@
main(argc, argv)
tcsetattr(STDERR_FILENO, TCSADRAIN, &mode);
}
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';
if (p = strpbrk(p, "|:")) {
savech = *p;
*p = '\0';