ANU News Patch Patch ID: 940114_news.c!bailey@genetics.upenn.edu Date: 14-Jan-1994 Author: Charles Bailey bailey@genetics.upenn.edu News Version: 6.1beta8 News Files: News.C Description: Changes order of precedence for determining NNTP server and transport protocol so that for server name, /Netserver=nodename > name in NewsRC file > logical News_NNTP_Server and for NNTP protocol name /NetProtocol=nodename > code in NewsRC file > logical News_NNTP_Protocol. Superseded: Included in version 6.1beta9 distribution. *** news.c --- news_new.c ************** *** 44,46 **-- **/ --- 44,49 ----- + ** V6.1b8 14-Jan-1994 Charles Bailey bailey@genetics.upenn.edu + ** - changed handling of /NetServer and /NetProtocol qualifiers + ** so they override values stored in NewsRC file **-- **/ ************** *** 117,130 lower_case(nntp_node); nntp_sts = 2; } ! 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'; ! } ! if (!explicit_proto) { ! if (gotenv = news_getenv("NEWS_NNTP_PROTOCOL",0)) strcpy(usr_inp,gotenv); ! else *usr_inp = '\0'; ! } if (*usr_inp) { nntp_sts += 2; --- 122,131 ----- lower_case(nntp_node); nntp_sts = 2; } ! } ! else if (sts == CLI$_NEGATED) { ! nntp_sts = -1; ! } if ((nntp_sts != -1) && (cli$get_value(c$dsc("NETPROTOCOL"),&usr_inp_dsc,&usr_inp_l) & 1)) { ************** *** 126,143 else *usr_inp = '\0'; } ! if (*usr_inp) { ! nntp_sts += 2; ! 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 --- 127,153 ----- 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); ! 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 ************** *** 139,145 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 --- 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 ************** *** 141,147 #if MULTINET nntp_proto = 3; #elif TWG ! nntp_proto = 2; #elif UCX nntp_proto = 4; #elif EXOS --- 151,157 ----- #if MULTINET nntp_proto = 3; #elif TWG ! nntp_proto = 2; #elif UCX nntp_proto = 4; #elif EXOS ************** *** 143,149 #elif TWG nntp_proto = 2; #elif UCX ! nntp_proto = 4; #elif EXOS nntp_proto = 5; #elif TCPWARE --- 153,159 ----- #elif TWG nntp_proto = 2; #elif UCX ! nntp_proto = 4; #elif EXOS nntp_proto = 5; #elif TCPWARE ************** *** 145,151 #elif UCX nntp_proto = 4; #elif EXOS ! nntp_proto = 5; #elif TCPWARE nntp_proto = 6; #else --- 155,161 ----- #elif UCX nntp_proto = 4; #elif EXOS ! nntp_proto = 5; #elif TCPWARE nntp_proto = 6; #else ************** *** 147,153 #elif EXOS nntp_proto = 5; #elif TCPWARE ! nntp_proto = 6; #else nntp_proto = 1; #endif --- 157,163 ----- #elif EXOS nntp_proto = 5; #elif TCPWARE ! nntp_proto = 6; #else nntp_proto = 1; #endif ************** *** 149,155 #elif TCPWARE nntp_proto = 6; #else ! nntp_proto = 1; #endif else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* --- 159,165 ----- #elif TCPWARE nntp_proto = 6; #else ! nntp_proto = 1; #endif else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* ************** *** 151,157 #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" . --- 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" . ************** *** 156,165 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); ! } } } else if (sts == CLI$_NEGATED) { --- 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); } } ************** *** 162,170 } } } - else if (sts == CLI$_NEGATED) { - nntp_sts = -1; - } if (cli$present(c$dsc("SCAN")) & 1) { *scangroups = '\0'; --- 171,176 ----- exit(1); } } if (cli$present(c$dsc("SCAN")) & 1) { *scangroups = '\0'; ************** *** 204,210 } } ! /* if news_root is not defined then look to see about news_nntp_server and assume that an nntp session is whats required */ if (!news_getenv("NEWS_ROOT",1)) { if (nntp_sts == 0 && (gotenv = news_getenv("NEWS_NNTP_SERVER",0)) != 0) { --- 210,216 ----- } } ! /* if news_root is not defined then assume that an nntp session is whats required */ if (!nntp_sts && !news_getenv("NEWS_ROOT",1)) { if ((gotenv = news_getenv("NEWS_NNTP_SERVER",0)) != 0) { ************** *** 206,213 /* if news_root is not defined then look to see about news_nntp_server and assume that an nntp session is whats required */ ! if (!news_getenv("NEWS_ROOT",1)) { ! if (nntp_sts == 0 && (gotenv = news_getenv("NEWS_NNTP_SERVER",0)) != 0) { strcpy(nntp_node,gotenv); lower_case(nntp_node); nntp_sts = 2; --- 212,219 ----- /* if news_root is not defined then assume that an nntp session is whats required */ ! if (!nntp_sts && !news_getenv("NEWS_ROOT",1)) { ! if ((gotenv = news_getenv("NEWS_NNTP_SERVER",0)) != 0) { strcpy(nntp_node,gotenv); lower_case(nntp_node); nntp_sts = 2; ************** *** 211,229 strcpy(nntp_node,gotenv); lower_case(nntp_node); nntp_sts = 2; ! if (gotenv = news_getenv("NEWS_NNTP_PROTOCOL",0)) { ! strcpy(usr_inp,gotenv); ! nntp_sts += 2; ! 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 --- 217,236 ----- strcpy(nntp_node,gotenv); lower_case(nntp_node); nntp_sts = 2; ! } ! if (gotenv = news_getenv("NEWS_NNTP_PROTOCOL",0)) { ! strcpy(usr_inp,gotenv); ! nntp_sts = nntp_sts ? 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 ************** *** 225,231 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 --- 232,238 ----- 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 ************** *** 227,233 #if MULTINET nntp_proto = 3; #elif TWG ! nntp_proto = 2; #elif UCX nntp_proto = 4; #elif EXOS --- 234,240 ----- #if MULTINET nntp_proto = 3; #elif TWG ! nntp_proto = 2; #elif UCX nntp_proto = 4; #elif EXOS ************** *** 229,235 #elif TWG nntp_proto = 2; #elif UCX ! nntp_proto = 4; #elif EXOS nntp_proto = 5; #elif TCPWARE --- 236,242 ----- #elif TWG nntp_proto = 2; #elif UCX ! nntp_proto = 4; #elif EXOS nntp_proto = 5; #elif TCPWARE ************** *** 231,237 #elif UCX nntp_proto = 4; #elif EXOS ! nntp_proto = 5; #elif TCPWARE nntp_proto = 6; #else --- 238,244 ----- #elif UCX nntp_proto = 4; #elif EXOS ! nntp_proto = 5; #elif TCPWARE nntp_proto = 6; #else ************** *** 233,239 #elif EXOS nntp_proto = 5; #elif TCPWARE ! nntp_proto = 6; #else nntp_proto = 1; #endif --- 240,246 ----- #elif EXOS nntp_proto = 5; #elif TCPWARE ! nntp_proto = 6; #else nntp_proto = 1; #endif ************** *** 235,241 #elif TCPWARE nntp_proto = 6; #else ! nntp_proto = 1; #endif else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* --- 242,248 ----- #elif TCPWARE nntp_proto = 6; #else ! nntp_proto = 1; #endif else if (!strncmp(usr_inp,"tcpware",usr_inp_l)) nntp_proto = 6; /* ************** *** 237,243 #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" . --- 244,250 ----- #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" . ************** *** 242,251 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); ! } } } } --- 249,257 ----- 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); } } } ************** *** 308,314 else nntp_sts = 4; } ! if (cp && nntp_sts < 3) { nntp_proto = atoi(cp); nntp_sts = 4; } --- 314,320 ----- else nntp_sts = 4; } ! if (cp && !explicit_proto) { nntp_proto = atoi(cp); nntp_sts = 4; } *** patchlist.h;-1 --- patchlist.h ************** *** 1,1 =+=+= End =+=+= --- 1,2 ----- + 940114_news.c!bailey@genetics.upenn.edu =+=+= End =+=+=