ANU News Patch Patch ID: 940118_news.c!bailey@genetics.upenn.edu Date: 18-Jan-1994 Author: Charles Bailey bailey@genetics.upenn.edu News Version: 6.1beta8 News Files: News.C Description: Fixes bug introduced by 940114_news.c!bailey@genetics.upenn.edu, which caused News to start a remote session if any command line parameters or qualifiers were specified and the logical name News_NNTP_Protocol was defined. Requires: 940114_news.c!bailey@genetics.upenn.edu Superseded: Included in version 6.1beta9 distribution. *** news.c --- news_new.c ************** *** 47,49 **-- **/ --- 47,52 ----- + ** V6.1b8 18-Jan-1994 Charles Bailey bailey@genetics.upenn.edu + ** - fixed bug introduced by 14-Jan-1994 patch which causes remote + ** session to occur even though News_Root is defined **-- **/ ************** *** 127,136 nntp_sts = -1; } ! if ((nntp_sts != -1) && ! (cli$get_value(c$dsc("NETPROTOCOL"),&usr_inp_dsc,&usr_inp_l) & 1)) { ! explicit_proto = usr_inp_l; ! usr_inp[usr_inp_l] = '\0'; } if (!explicit_proto) { if (gotenv = news_getenv("NEWS_NNTP_PROTOCOL",0)) strcpy(usr_inp,gotenv); --- 130,144 ----- nntp_sts = -1; } ! if ((nntp_sts != -1) && (cli$present(c$dsc("NETPROTOCOL")) & 1)) { ! if (cli$get_value(c$dsc("NETPROTOCOL"),&usr_inp_dsc,&usr_inp_l) & 1) { ! explicit_proto = usr_inp_l; ! usr_inp[usr_inp_l] = '\0'; ! } ! else { ! if (gotenv = news_getenv("NEWS_NNTP_PROTOCOL",0)) ! strcpy(usr_inp,gotenv); ! else *usr_inp = '\0'; } if (*usr_inp) { nntp_sts = (nntp_sts == 2) ? 4 : 3; ************** *** 132,153 explicit_proto = usr_inp_l; usr_inp[usr_inp_l] = '\0'; } ! if (!explicit_proto) { ! if (gotenv = news_getenv("NEWS_NNTP_PROTOCOL",0)) strcpy(usr_inp,gotenv); ! else *usr_inp = '\0'; ! } ! if (*usr_inp) { ! nntp_sts = (nntp_sts == 2) ? 4 : 3; ! lower_case(usr_inp); ! usr_inp_l = strlen(usr_inp); ! if (!*usr_inp) nntp_proto = 0; ! else if (!strncmp(usr_inp,"decnet",usr_inp_l)) nntp_proto= 0; ! else if (!strncmp(usr_inp,"cmutcp",usr_inp_l)) nntp_proto= 1; ! else if (!strncmp(usr_inp,"wintcp",usr_inp_l)) nntp_proto = 2; ! else if (!strncmp(usr_inp,"multinettcp",usr_inp_l)) nntp_proto = 3; ! else if (!strncmp(usr_inp,"ucxtcp",usr_inp_l)) nntp_proto = 4; ! else if (!strncmp(usr_inp,"exostcp",usr_inp_l)) nntp_proto = 5; ! else if (!strncmp(usr_inp,"tcp",usr_inp_l)) #if MULTINET nntp_proto = 3; #elif TWG --- 140,157 ----- strcpy(usr_inp,gotenv); else *usr_inp = '\0'; } ! if (*usr_inp) { ! nntp_sts = (nntp_sts == 2) ? 4 : 3; ! lower_case(usr_inp); ! usr_inp_l = strlen(usr_inp); ! if (!*usr_inp) nntp_proto = 0; ! else if (!strncmp(usr_inp,"decnet",usr_inp_l)) nntp_proto= 0; ! else if (!strncmp(usr_inp,"cmutcp",usr_inp_l)) nntp_proto= 1; ! else if (!strncmp(usr_inp,"wintcp",usr_inp_l)) nntp_proto = 2; ! else if (!strncmp(usr_inp,"multinettcp",usr_inp_l)) nntp_proto = 3; ! else if (!strncmp(usr_inp,"ucxtcp",usr_inp_l)) nntp_proto = 4; ! else if (!strncmp(usr_inp,"exostcp",usr_inp_l)) nntp_proto = 5; ! else if (!strncmp(usr_inp,"tcp",usr_inp_l)) #if MULTINET nntp_proto = 3; #elif TWG ************** *** 149,155 else if (!strncmp(usr_inp,"exostcp",usr_inp_l)) nntp_proto = 5; else if (!strncmp(usr_inp,"tcp",usr_inp_l)) #if MULTINET ! nntp_proto = 3; #elif TWG nntp_proto = 2; #elif UCX --- 153,159 ----- else if (!strncmp(usr_inp,"exostcp",usr_inp_l)) nntp_proto = 5; else if (!strncmp(usr_inp,"tcp",usr_inp_l)) #if MULTINET ! nntp_proto = 3; #elif TWG nntp_proto = 2; #elif UCX ************** *** 151,157 #if MULTINET nntp_proto = 3; #elif TWG ! nntp_proto = 2; #elif UCX nntp_proto = 4; #elif EXOS --- 155,161 ----- #if MULTINET nntp_proto = 3; #elif TWG ! nntp_proto = 2; #elif UCX nntp_proto = 4; #elif EXOS ************** *** 153,159 #elif TWG nntp_proto = 2; #elif UCX ! nntp_proto = 4; #elif EXOS nntp_proto = 5; #elif TCPWARE --- 157,163 ----- #elif TWG nntp_proto = 2; #elif UCX ! nntp_proto = 4; #elif EXOS nntp_proto = 5; #elif TCPWARE ************** *** 155,161 #elif UCX nntp_proto = 4; #elif EXOS ! nntp_proto = 5; #elif TCPWARE nntp_proto = 6; #else --- 159,165 ----- #elif UCX nntp_proto = 4; #elif EXOS ! nntp_proto = 5; #elif TCPWARE nntp_proto = 6; #else ************** *** 157,163 #elif EXOS nntp_proto = 5; #elif TCPWARE ! nntp_proto = 6; #else nntp_proto = 1; #endif --- 161,167 ----- #elif EXOS nntp_proto = 5; #elif TCPWARE ! nntp_proto = 6; #else nntp_proto = 1; #endif ************** *** 159,165 #elif TCPWARE nntp_proto = 6; #else ! nntp_proto = 1; #endif else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* --- 163,169 ----- #elif TCPWARE nntp_proto = 6; #else ! nntp_proto = 1; #endif else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* ************** *** 161,167 #else nntp_proto = 1; #endif ! else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* Since string "TCP" is a leading substring in "TCPWARE" a match for generic "TCP" should be made before trying to match "TCPWARE" . --- 165,171 ----- #else nntp_proto = 1; #endif ! else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* Since string "TCP" is a leading substring in "TCPWARE" a match for generic "TCP" should be made before trying to match "TCPWARE" . ************** *** 166,174 Since string "TCP" is a leading substring in "TCPWARE" a match for generic "TCP" should be made before trying to match "TCPWARE" . */ ! else { ! printf("NEWS/NETPROTOCOL=%s: Not a valid NNTP transport protocol code\n",usr_inp); ! exit(1); } } --- 170,179 ----- Since string "TCP" is a leading substring in "TCPWARE" a match for generic "TCP" should be made before trying to match "TCPWARE" . */ ! else { ! printf("NEWS/NETPROTOCOL=%s: Not a valid NNTP transport protocol code\n",usr_inp); ! exit(1); ! } } } *** patchlist.h;-1 --- patchlist.h ************** *** 1,1 =+=+= End =+=+= --- 1,2 ----- + 940118_news.c!bailey@genetics.upenn.edu =+=+= End =+=+=