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