diff -cr stunnel-3.20/options.c stunnel-3.20-envconn/options.c *** stunnel-3.20/options.c Sun Aug 12 23:46:48 2001 --- stunnel-3.20-envconn/options.c Thu Sep 6 20:24:19 2001 *************** *** 44,49 **** --- 44,58 ---- static void print_option(int type, opt_union *val); static int parse_socket_option(char *optarg); + void parse_environment(void) + { + char *remote=getenv("STUNNEL_CLIENT_CONNECT"); + if (remote) { + name2nums(remote, &options.remotenames, &options.remoteport); + options.option |= OPT_REMOTE; + } + } + void parse_options(int argc, char *argv[]) { /* get options and set global variables */ int c; *************** *** 74,79 **** --- 83,91 ---- options.output_file=NULL; options.local_ip=NULL; opterr=0; + + parse_environment(); + while ((c = getopt(argc, argv, "A:a:cp:v:d:fTl:L:r:s:g:t:u:n:N:hC:D:O:E:R:WB:VP:S:o:I:")) != EOF) switch (c) { case 'A':