Licensing Information
Open Source Used In Cisco DSP IP Cameras 418
for(i = l; i; i = next) {
/* Is this a 'skip' capability? */
len = strlen(i->cap);
if (strchr(i->cap, '=') == NULL && i->cap[len-1] == '@') {
next = i->next;
free(i);
continue;
}
/* Check for buffer overflow. */
count += len + 1;
if (count >= maxlen) {
write(2, "tgetent: warning: termcap entry too long\n", 41);
break;
}
/* Add capability to buffer. */
for(bp = i->cap; *bp; bp++)
*sp++ = *bp;
*sp++ = ':';
/* Free space. */
next = i->next;
free(i);
}
*sp = 0;
return(1);
}
/* Generic "find capability" routine. */
static char *find_cap(char *bp, const char *cap, char sep)
{
#if MULTIPLE_CHAR_CAP /* Disabled because it breaks some programs */
int len = strlen(cap);
if (len == 2) {
#endif
/* Normal case, do fast lookup. */
while(*bp) {
if (bp[0] == ':' &&
bp[1] == cap[0] &&
bp[2] == cap[1] &&
bp[3] == sep) return(bp + 4);
bp++;
}
return(NULL);