31,9 → 31,10 |
* SUCH DAMAGE. |
*/ |
|
/* |
#ifndef lint |
static char sccsid[] = "@(#)termcap.c 5.6 (Berkeley) 7/3/92"; |
#endif /* not lint */ |
#endif */ /* not lint */ |
|
#define BUFSIZ 1024 |
#define MAXHOP 32 /* max number of tc= indirections */ |
44,6 → 45,16 |
#include <stdlib.h> |
#include "pathnames.h" |
|
#include <string.h> |
#include <unistd.h> |
#include <fcntl.h> |
|
|
int tnamatch(); |
int tnchktc(); |
int tfindent(); |
|
|
/* |
* termcap - routines for dealing with the terminal capability data base |
* |
76,7 → 87,7 |
register char *p; |
register char *cp; |
register int c; |
char *term, *home, *termpath; |
char /* *term,*/ *home, *termpath; |
char **fname = pathvec; |
|
pvec = pathvec; |
94,10 → 105,10 |
* becomes "$HOME/.termcap /etc/termcap" if no TERMPATH exists. |
*/ |
if (!cp || *cp != '/') { /* no TERMCAP or it holds an entry */ |
if (termpath = getenv("TERMPATH")) |
if ( (termpath = getenv("TERMPATH")) ) |
strncpy(pathbuf, termpath, PBUFSIZ); |
else { |
if (home = getenv("HOME")) { /* set up default */ |
if ( (home = getenv("HOME")) ) { /* set up default */ |
p += strlen(home); /* path, looking in */ |
strcpy(pathbuf, home); /* $HOME first */ |
*p++ = '/'; |