f3e6c7
--- netkit-telnet-0.17-pre-20000204/telnet/commands.c.env	Thu Apr  8 19:30:20 1999
f3e6c7
+++ netkit-telnet-0.17-pre-20000204/telnet/commands.c	Tue May 16 17:19:47 2000
f3e6c7
@@ -1815,11 +1815,11 @@
f3e6c7
 }
f3e6c7
 
f3e6c7
 	unsigned char *
f3e6c7
-env_getvalue(unsigned char *var)
f3e6c7
+env_getvalue(unsigned char *var, int exported_only)
f3e6c7
 {
f3e6c7
-	struct env_lst *ep;
f3e6c7
+	struct env_lst *ep = env_find(var);
f3e6c7
 
f3e6c7
-	if ((ep = env_find(var)))
f3e6c7
+	if (ep && (!exported_only || ep->export))
f3e6c7
 		return(ep->value);
f3e6c7
 	return(NULL);
f3e6c7
 }
f3e6c7
--- netkit-telnet-0.17-pre-20000204/telnet/telnet.c.env	Tue May 16 17:19:47 2000
f3e6c7
+++ netkit-telnet-0.17-pre-20000204/telnet/telnet.c	Tue May 16 17:19:47 2000
f3e6c7
@@ -438,7 +438,7 @@
f3e6c7
 #endif
f3e6c7
 
f3e6c7
 	    case TELOPT_XDISPLOC:	/* X Display location */
f3e6c7
-		if (env_getvalue((unsigned char *)"DISPLAY"))
f3e6c7
+		if (env_getvalue((unsigned char *)"DISPLAY", 0))
f3e6c7
 		    new_state_ok = 1;
f3e6c7
 		break;
f3e6c7
 
f3e6c7
@@ -693,7 +693,7 @@
f3e6c7
 		resettermname = 0;
f3e6c7
 		if (tnamep && tnamep != unknown)
f3e6c7
 			free(tnamep);
f3e6c7
-		if ((tname = (char *)env_getvalue((unsigned char *)"TERM")) &&
f3e6c7
+		if ((tname = (char *)env_getvalue((unsigned char *)"TERM", 0)) &&
f3e6c7
 				(setupterm(tname, 1, &errret) == 0)) {
f3e6c7
 			tnamep = mklist(ttytype, tname);
f3e6c7
 		} else {
f3e6c7
@@ -870,7 +870,7 @@
f3e6c7
 	    unsigned char temp[50], *dp;
f3e6c7
 	    int len;
f3e6c7
 
f3e6c7
-	    if ((dp = env_getvalue((unsigned char *)"DISPLAY")) == NULL) {
f3e6c7
+	    if ((dp = env_getvalue((unsigned char *)"DISPLAY", 0)) == NULL) {
f3e6c7
 		/*
f3e6c7
 		 * Something happened, we no longer have a DISPLAY
f3e6c7
 		 * variable.  So, turn off the option.
f3e6c7
@@ -1527,7 +1527,7 @@
f3e6c7
 			env_opt_add(ep);
f3e6c7
 		return;
f3e6c7
 	}
f3e6c7
-	vp = env_getvalue(ep);
f3e6c7
+	vp = env_getvalue(ep, 1);
f3e6c7
 	if (opt_replyp + (vp ? strlen((char *)vp) : 0) +
f3e6c7
 				strlen((char *)ep) + 6 > opt_replyend)
f3e6c7
 	{
f3e6c7
@@ -2170,7 +2170,7 @@
f3e6c7
 	send_will(TELOPT_LINEMODE, 1);
f3e6c7
 	send_will(TELOPT_NEW_ENVIRON, 1);
f3e6c7
 	send_do(TELOPT_STATUS, 1);
f3e6c7
-	if (env_getvalue((unsigned char *)"DISPLAY"))
f3e6c7
+	if (env_getvalue((unsigned char *)"DISPLAY", 0))
f3e6c7
 	    send_will(TELOPT_XDISPLOC, 1);
f3e6c7
 	if (binary)
f3e6c7
 	    tel_enter_binary(binary);
f3e6c7
--- netkit-telnet-0.17-pre-20000204/telnet/externs.h.env	Mon Feb  8 15:56:11 1999
f3e6c7
+++ netkit-telnet-0.17-pre-20000204/telnet/externs.h	Tue May 16 17:19:47 2000
f3e6c7
@@ -203,7 +203,7 @@
f3e6c7
 void env_send (unsigned char *);
f3e6c7
 void env_list (void);
f3e6c7
 unsigned char * env_default(int init, int welldefined);
f3e6c7
-unsigned char * env_getvalue(unsigned char *var);
f3e6c7
+unsigned char * env_getvalue(unsigned char *var, int exported_only);
f3e6c7
 
f3e6c7
 void set_escape_char(char *s);
f3e6c7
 unsigned long sourceroute(char *arg, char **cpp, int *lenp);
f3e6c7
@@ -335,7 +335,7 @@
f3e6c7
 void     env_opt_end (int);
f3e6c7
 
f3e6c7
 unsigned char     *env_default (int, int);
f3e6c7
-unsigned char     *env_getvalue (unsigned char *);
f3e6c7
+unsigned char     *env_getvalue (unsigned char *, int);
f3e6c7
 
f3e6c7
 int get_status (void);
f3e6c7
 int dosynch (void);