better checks for recursion in tc=
This commit is contained in:
parent
32e5679d6c
commit
e102a3f5cb
1 changed files with 7 additions and 2 deletions
|
@ -112,12 +112,17 @@ check_for_tc()
|
|||
return(0); /* no : in termcap entry */
|
||||
if (p[1] != 't' || p[2] != 'c')
|
||||
return(1);
|
||||
if (++count > 16) return(0); /* recursion in tc= definitions */
|
||||
if (count > 16) return(0); /* recursion in tc= definitions */
|
||||
count++;
|
||||
strcpy(terminalname, &p[4]);
|
||||
q = terminalname;
|
||||
while (*q && *q != ':') q++;
|
||||
*q = 0;
|
||||
if (tgetent(buf, terminalname) != 1) return(0);
|
||||
if (tgetent(buf, terminalname) != 1) {
|
||||
---count;
|
||||
return(0);
|
||||
}
|
||||
--count;
|
||||
for (q = buf; *q && *q != ':'; q++) { }
|
||||
strcpy(p, q);
|
||||
capab = savcapab;
|
||||
|
|
Loading…
Reference in a new issue