SCCS-vsn: usr.bin/tip/remcap.c 4.3
-/* remcap.c 4.2 81/05/20 */
+/* remcap.c 4.3 81/05/21 */
/* Copyright (c) 1979 Regents of the University of California */
#define BUFSIZ 1024
#define MAXHOP 32 /* max number of tc= indirections */
/* Copyright (c) 1979 Regents of the University of California */
#define BUFSIZ 1024
#define MAXHOP 32 /* max number of tc= indirections */
#define tgetflag rgetflag
#define tgetstr rgetstr
#undef E_TERMCAP
#define tgetflag rgetflag
#define tgetstr rgetstr
#undef E_TERMCAP
-#define E_TERMCAP "/etc/remote"
-#define V6 /* don't look in environment */
+#define E_TERMCAP RM = "/etc/remote"
+#define V_TERMCAP "REMOTE"
+#define V_TERM "HOST"
+
+#else
+#define V_TERMCAP "TERMCAP"
+#define V_TERM "TERM"
tbuf = bp;
tf = 0;
#ifndef V6
tbuf = bp;
tf = 0;
#ifndef V6
- cp = getenv("TERMCAP");
+ cp = getenv(V_TERMCAP);
/*
* TERMCAP can have one of two things in it. It can be the
* name of a file to use instead of /etc/termcap. In this
/*
* TERMCAP can have one of two things in it. It can be the
* name of a file to use instead of /etc/termcap. In this
*/
if (cp && *cp) {
if (*cp!='/') {
*/
if (cp && *cp) {
if (*cp!='/') {
if (cp2==(char *) 0 || strcmp(name,cp2)==0) {
strcpy(bp,cp);
return(tnchktc());
if (cp2==(char *) 0 || strcmp(name,cp2)==0) {
strcpy(bp,cp);
return(tnchktc());
tf = open(E_TERMCAP, 0);
}
} else
tf = open(E_TERMCAP, 0);
}
} else
+#ifdef REMOTE
+ tf = open(RM = cp, 0);
+#else
}
if (tf==0)
tf = open(E_TERMCAP, 0);
#else
}
if (tf==0)
tf = open(E_TERMCAP, 0);
#else
-#ifdef REMOTE
- if ((RM = getenv("REMOTE")) == (char *)0)
- RM = E_TERMCAP;
- tf = open(RM, 0);
-#endif
tf = open(E_TERMCAP, 0);
#endif
if (tf < 0)
tf = open(E_TERMCAP, 0);
#endif
if (tf < 0)