Licensing Information
Open Source Used In Cisco DSP IP Cameras 415
break;
}
}
if (*sp == '\n') break;
}
/* Save buffer to malloced area. */
*bufp++ = 0;
if (status == 0) return(NULL);
if ((sp = xmalloc(bufp - buf)) == NULL) return(sp);
memcpy(sp, buf, bufp - buf);
return(sp);
}
/* Read terminal description. */
static char *tc_read(struct tc_ent **tcp, char *term)
{
FILE *fp;
char *sp, *tc;
char *desc = NULL;
char *tc_file = "/etc/termcap";
struct tc_ent *l = NULL;
int first = 1;
int loop = 0;
*tcp = NULL;
/* See if we have a TERMCAP environment variable. */
if ((tc = getenv("TERMCAP")) != NULL) {
if (*tc == '/')
tc_file = tc;
else {
/* check if TERMCAP is term */
if (tc_comp(tc, term)) {
#if DEBUG
printf("Using TERMCAP\n");
#endif
/* Just read the TERMCAP variable. */
sp = strsave(tc);
tc = build_list(&l, sp);
if (tc) free(tc);
*tcp = l;
return(sp);
}
}
}
#if DEBUG










