[news.software.anu-news] NEWS V5.9B diff/patch 5/11

gih900@csc.anu.oz (Geoff Huston) (11/25/89)

+-+-+-+ Beginning of part 5 +-+-+-+
X         distribution[512], id[256], from[256], follow_groups[512],
X         xnewsgroups[512], xfollowgroups[512],
V         followup_groups[512], ref_line[256], old_ref_line[256], subj_line[25
X6],
X!        mod_address[132], post_address[256], control_val[256],
X         *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X    int approval_required = 0,
X        add_approved = 1,
X**************
X*** 317,322
X          mod_address[132], post_address[256],
X         *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X    int approval_required = 0,
X        fd,
X        g,
X        use_default = 1,
X--- 319,325 -----
X         mod_address[132], post_address[256], control_val[256],
X         *cp, *p, *c1, *c2, *cn1, *cn2, *xx, *yy, *zz, lg[132], *pa;
X    int approval_required = 0,
X+       add_approved = 1,
X        fd,
X        g,
X        use_default = 1,
X**************
X*** 336,342
X    $DESCRIPTOR(infile_dsc,infile);
X `032
X    itm_approved = 0;
X!   *post_dist = *follow_groups = *followup_groups = '\0';
X `032
X    if (cli$present(c$dsc("HEADERS")) & 1) use_default = 0;
X    mail_self = (cli$present(c$dsc("SELF")) & 1);
X--- 339,345 -----
X    $DESCRIPTOR(infile_dsc,infile);
X `032
X    itm_approved = 0;
V!   *post_dist = *follow_groups = *followup_groups = *xnewsgroups = *xfollowg
Xroups = '\0';
X `032
X    if (crosspost) `123
X      use_default = 1;
X**************
X*** 338,346
X    itm_approved = 0;
X    *post_dist = *follow_groups = *followup_groups = '\0';
X `032
X!   if (cli$present(c$dsc("HEADERS")) & 1) use_default = 0;
X!   mail_self = (cli$present(c$dsc("SELF")) & 1);
X!   edit_switch = (cli$present(c$dsc("EDIT")) & 1);
X `032
X    if (postfile) `123
X      if (cli$present(c$dsc("CONTROL")) & 1) `123
X--- 341,357 -----
X    itm_approved = 0;
V    *post_dist = *follow_groups = *followup_groups = *xnewsgroups = *xfollowg
Xroups = '\0';
X `032
X!   if (crosspost) `123
X!     use_default = 1;
X!     mail_self = 0;
X!     edit_switch = 0;
X!     postfile = 0;
X!     `125
X!   else `123
X!     if (cli$present(c$dsc("HEADERS")) & 1) use_default = 0;
X!     mail_self = (cli$present(c$dsc("SELF")) & 1);
X!     edit_switch = (cli$present(c$dsc("EDIT")) & 1);
X!     `125
X `032
X    if (postfile) `123
X      if (cli$present(c$dsc("CONTROL")) & 1) `123
X**************
X*** 346,351
X      if (cli$present(c$dsc("CONTROL")) & 1) `123
V        if (no_priv()) return(err_line("\tError: Post - No privs for Control
X message generation\n"),0);
X        control_switch = 1;
X        `125
X `032
V      if (cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) == CLI$_ABSE
XNT) *infile = '\0';
X--- 357,377 -----
X      if (cli$present(c$dsc("CONTROL")) & 1) `123
V        if (no_priv()) return(err_line("\tError: Post - No privs for Control
X message generation\n"),0);
X        control_switch = 1;
X+       if (!(cli$get_value(c$dsc("CONTROL"),&infile_dsc,&infile_len) & 1))
X+         get_input(&infile_dsc,c$dsc("Control: "),&infile_len);
X+       infile[infile_len] = '\0';
X+       if (!infile_len)`032
V+         return(err_line("\tError: Post/Control - No control message entered
X\n"),0);
X+       strcpy(control_val,infile);
X+       sprintf(err_oline,"Add Approved: header to control posting [y]:");
X+       status = get_input(&command,c$dsc(err_oline),&response_length);
X+       if ((status == RMS$_EOF) `124`124 (status == SMG$_EOF))
X+         return(err_line("\tPost - Canceled\n"),0);
X+       if (!(   (status & 1)
X+             && (   !response_length
X+                 `124`124 (   response_length
X+                     && (toupper(*response) == 'Y')))))
X+         add_approved = 0;
X        `125
X `032
V      if (cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) == CLI$_ABSE
XNT) *infile = '\0';
X**************
X*** 357,363
X        s[s_len] = '\0';
X        `125
X `032
X!     parse_newsgroups(ngroup,((curr_g) ? ga[curr_g]->grp_name : ""),0,1);
X      if (!*ngroup) `123
X        err_line("\tError: Post - No Authorized Newsgroups specified\n");
X        return(0);
X--- 383,389 -----
X        s[s_len] = '\0';
X        `125
X `032
X!     parse_newsgroups(ngroup,((curr_g) ? ga[curr_g]->grp_name : ""),0,1,1);
X      if (!*ngroup) `123
X        err_line("\tError: Post - No Authorized Newsgroups specified\n");
X        return(0);
X**************
X*** 399,406
X        return(0);
X        `125
X `032
X!     extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X!     if (!(cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) & 1))
X        *infile = '\0';
X      else infile[infile_len] = '\0';
X `032
X--- 425,432 -----
X        return(0);
X        `125
X `032
X!     if (crosspost) `123
X!       extract_orig = 1;
X        *infile = '\0';
X        `125
X      else `123
X**************
X*** 402,412
X      extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X      if (!(cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) & 1))
X        *infile = '\0';
X-     else infile[infile_len] = '\0';
X-`032
X-     if ((!*infile) && (!edit_switch)) `123
X-       err_line("\tError: Post - no file to post\n");
X-       return(0);
X        `125
X `032
X      fd = creat(Post_file,0,"rat=cr","rfm=var");
X--- 428,433 -----
X      if (crosspost) `123
X        extract_orig = 1;
X        *infile = '\0';
X        `125
X      else `123
X        extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X**************
X*** 408,413
X        err_line("\tError: Post - no file to post\n");
X        return(0);
X        `125
X `032
X      fd = creat(Post_file,0,"rat=cr","rfm=var");
X      if ((fd == -1) `124`124 (!(fpw = fdopen(fd,"w")))) `123
X--- 429,444 -----
X        extract_orig = 1;
X        *infile = '\0';
X        `125
X+     else `123
X+       extract_orig = (cli$present(c$dsc("EXTRACT")) & 1);
X+       if (!(cli$get_value(c$dsc("INFILE"),&infile_dsc,&infile_len) & 1))
X+         *infile = '\0';
X+       else infile[infile_len] = '\0';
X+       if ((!*infile) && (!edit_switch)) `123
X+         err_line("\tError: Post - no file to post\n");
X+         return(0);
X+         `125
X+       `125
X `032
X      fd = creat(Post_file,0,"rat=cr","rfm=var");
X      if ((fd == -1) `124`124 (!(fpw = fdopen(fd,"w")))) `123
X**************
X*** 422,429
X        while (fgets(xfrbuf,512,fpr)) `123
X          if (header) `123
X            if (extract_orig) `123
X!             fputs(">",fpw);
X!             if (*xfrbuf != '>') fputs(" ",fpw);
X              fputs(xfrbuf,fpw);
X              `125
X            `125
X--- 453,462 -----
X        while (fgets(xfrbuf,512,fpr)) `123
X          if (header) `123
X            if (extract_orig) `123
X!             if (!crosspost) `123
X!               fputs(">",fpw);
X!               if (*xfrbuf != '>') fputs(" ",fpw);
X!               `125
X              fputs(xfrbuf,fpw);
X              `125
X            `125
X**************
X*** 441,447
X            `125
X          else if (!strncmp(xfrbuf,"Subject:",8)) `123
X            strcpy(subj_line,"Subject: ");
V!           if ((strncmp(&xfrbuf[9],"Re: ",4)) && (strncmp(&xfrbuf[9],"re: ",
X4))) strcat(subj_line,"Re: ");
X            strcat(subj_line,&xfrbuf[9]);
X            strcpy(s,&subj_line[9]);
X            if (cp = strchr(s,'\n')) *cp = '\0';
X--- 474,482 -----
X            `125
X          else if (!strncmp(xfrbuf,"Subject:",8)) `123
X            strcpy(subj_line,"Subject: ");
X!           if (   !crosspost
X!               && strncmp(&xfrbuf[9],"Re: ",4)
X!               && strncmp(&xfrbuf[9],"re: ",4)) strcat(subj_line,"Re: ");
X            strcat(subj_line,&xfrbuf[9]);
X            strcpy(s,&subj_line[9]);
X            if (cp = strchr(s,'\n')) *cp = '\0';
X**************
X*** 446,455
X            strcpy(s,&subj_line[9]);
X            if (cp = strchr(s,'\n')) *cp = '\0';
X            `125
V!         else if ((!strncmp(xfrbuf,"Newsgroups:",11)) && (!*follow_groups))
X `123
X!           strcpy(follow_groups,&xfrbuf[12]);
X!           if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X!           s_to_lower(follow_groups);
X            `125
X          else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X            strcpy(follow_groups,&xfrbuf[13]);
X--- 481,493 -----
X            strcpy(s,&subj_line[9]);
X            if (cp = strchr(s,'\n')) *cp = '\0';
X            `125
X!         else if (!strncmp(xfrbuf,"Newsgroups:",11)) `123
X!           strcpy(xnewsgroups,&xfrbuf[12]);
X!           if (!*follow_groups) `123
X!             strcpy(follow_groups,&xfrbuf[12]);
X!             if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X!             s_to_lower(follow_groups);
X!             `125
X            `125
X          else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X            strcpy(follow_groups,&xfrbuf[13]);
X**************
X*** 453,458
X            `125
X          else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X            strcpy(follow_groups,&xfrbuf[13]);
X            if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X            s_to_lower(follow_groups);
X            strcpy(followup_groups,follow_groups);
X--- 491,497 -----
X            `125
X          else if (!strncmp(xfrbuf,"Followup-To:",12)) `123
X            strcpy(follow_groups,&xfrbuf[13]);
X+           strcpy(xfollowgroups,follow_groups);
X            if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X            s_to_lower(follow_groups);
X            strcpy(followup_groups,follow_groups);
X**************
X*** 456,462
X            if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X            s_to_lower(follow_groups);
X            strcpy(followup_groups,follow_groups);
X!           if (!strcmp(follow_groups,"poster")) `123
X              fclose(fpr);
X              if (*fp_open > 1) while (!delete(fp_open));
X              *fp_open = '\0';
X--- 495,501 -----
X            if (cp = strchr(follow_groups,'\n')) *cp = '\0';
X            s_to_lower(follow_groups);
X            strcpy(followup_groups,follow_groups);
X!           if (!crosspost && !strcmp(follow_groups,"poster")) `123
X              fclose(fpr);
X              if (*fp_open > 1) while (!delete(fp_open));
X              *fp_open = '\0';
X**************
X*** 467,472
X              `125
X            `125
X          else if (!strncmp(xfrbuf,"Distribution:",13)) `123
X            strcpy(distribution,&xfrbuf[14]);
X            if (cp = strchr(distribution,'\n')) *cp = '\0';
X            `125
X--- 506,512 -----
X              `125
X            `125
X          else if (!strncmp(xfrbuf,"Distribution:",13)) `123
X+           if (crosspost) fputs(xfrbuf,fpw);
X            strcpy(distribution,&xfrbuf[14]);
X            if (cp = strchr(distribution,'\n')) *cp = '\0';
X            `125
X**************
X*** 471,477
X            if (cp = strchr(distribution,'\n')) *cp = '\0';
X            `125
X          else if (*xfrbuf == '\n') `123
X!           if (extract_orig) `123
X              fputs("In article ",fpw);
V              if (!*id) sprintf(id,"<%s %s:%d>", news_node, ga[curr_g]->grp_n
Xame,ga[curr_g]->grp_ia[curr_i].itm_num);
X              fputs(id,fpw);
X--- 511,518 -----
X            if (cp = strchr(distribution,'\n')) *cp = '\0';
X            `125
X          else if (*xfrbuf == '\n') `123
X!           if (crosspost) fputs(xfrbuf,fpw);
X!           if (!crosspost && extract_orig) `123
X              fputs("In article ",fpw);
V              if (!*id) sprintf(id,"<%s %s:%d>", news_node, ga[curr_g]->grp_n
Xame,ga[curr_g]->grp_ia[curr_i].itm_num);
X              fputs(id,fpw);
X**************
X*** 479,484
X              `125
X            header = 1;
X            `125
X          `125
X        fclose(fpr);
X        if (*fp_open > 1) while (!delete(fp_open));
X--- 520,526 -----
X              `125
X            header = 1;
X            `125
X+         else if (crosspost && strncmp(xfrbuf,"Path:",5)) fputs(xfrbuf,fpw);
X          `125
X        fclose(fpr);
X        if (*fp_open > 1) while (!delete(fp_open));
X**************
X*** 489,499
X        fclose(fpr);
X        `125
X      *infile = '\0';
X!     parse_newsgroups(ngroup,follow_groups,1,1);
X!     if (fpr = profile_sigfile(ngroup)) `123
X!       fputs("-- \n",fpw);
X!       while (fgets(xfrbuf,512,fpr)) fputs(xfrbuf,fpw);
X!       fclose(fpr);
X        `125
X      fclose(fpw);
X `032
X--- 531,544 -----
X        fclose(fpr);
X        `125
X      *infile = '\0';
X!     if (crosspost) parse_newsgroups(ngroup,"",1,1,1);
X!     else `123
X!       parse_newsgroups(ngroup,follow_groups,1,1,1);
X!       if (fpr = profile_sigfile(ngroup)) `123
X!         fputs("-- \n",fpw);
X!         while (fgets(xfrbuf,512,fpr)) fputs(xfrbuf,fpw);
X!         fclose(fpr);
X!         `125
X        `125
X      fclose(fpw);
X `032
X**************
X*** 553,559
X    strcpy(loc_id,gen_id());
X    mail_add_expiry = 0;
X `032
X!   if (!subj_param) `123
X      if (!*s) status = get_input(&s_dsc,c$dsc("Subject: "),&s_len);
V      else status = get_input_dflt(&s_dsc,c$dsc("Subject: "),&s_len,c$dsc(s),
X0);
X      if ((status == RMS$_EOF) `124`124 (status == SMG$_EOF)) `123
X--- 598,604 -----
X    strcpy(loc_id,gen_id());
X    mail_add_expiry = 0;
X `032
X!   if (!subj_param && !crosspost) `123
X      if (!*s) status = get_input(&s_dsc,c$dsc("Subject: "),&s_len);
V      else status = get_input_dflt(&s_dsc,c$dsc("Subject: "),&s_len,c$dsc(s),
X0);
X      if ((status == RMS$_EOF) `124`124 (status == SMG$_EOF)) `123
X**************
X*** 624,630
X `032
X    fprintf(fpw,"Path: %s!%s\n",news_node,usr_username);
X    sprintf(post_path," %s!%s",news_node,usr_username);
X!   fprintf(fpw,"From: %s@%s",mail_sig,Node_address);
X    if (*usr_persname) fprintf(fpw," (%s)",usr_persname);
X    fprintf(fpw,"\n");
X    fprintf(fpw,"Newsgroups: %s\n",ngroup);
X--- 669,676 -----
X `032
X    fprintf(fpw,"Path: %s!%s\n",news_node,usr_username);
X    sprintf(post_path," %s!%s",news_node,usr_username);
X!   if (!crosspost) fprintf(fpw,"From: %s",mail_sig);
X!   else fprintf(fpw,"From: %s\nXPosted: %s",from,mail_sig);
X    if (*usr_persname) fprintf(fpw," (%s)",usr_persname);
X    fprintf(fpw,"\n");
X    fprintf(fpw,"Newsgroups: %s\n",ngroup);
X**************
X*** 628,634
X    if (*usr_persname) fprintf(fpw," (%s)",usr_persname);
X    fprintf(fpw,"\n");
X    fprintf(fpw,"Newsgroups: %s\n",ngroup);
X!   if (control_switch) fprintf(fpw,"Control: %s\n",s);
X    fprintf(fpw,"%s",subj_line);
X    fprintf(fpw,"Message-ID: %s\n",loc_id);
X    fprintf(fpw,"Date: %d %.3s %d %02d:%02d:%02d %s\n",
X--- 674,684 -----
X    if (*usr_persname) fprintf(fpw," (%s)",usr_persname);
X    fprintf(fpw,"\n");
X    fprintf(fpw,"Newsgroups: %s\n",ngroup);
X!   if (control_switch) `123
X!     fprintf(fpw,"Control: %s\n",control_val);
X!     if (add_approved) fprintf(fpw,"Approved: %s\n",mail_sig);
X!     `125
X!   else add_approved = 0;
X    fprintf(fpw,"%s",subj_line);
X    fprintf(fpw,"Message-ID: %s\n",loc_id);
X    fprintf(fpw,"Date: %d %.3s %d %02d:%02d:%02d %s\n",
X**************
X*** 635,640
X            stm->tm_mday,p,stm->tm_year,stm->tm_hour,stm->tm_min,stm->tm_sec,
X            news_timezone);
X    if (*ref_line) fputs(ref_line,fpw);
X `032
X    if (!use_default) `123
-+-+-+-+-+ End of part 5 +-+-+-+-+-