[news.software.anu-news] Another bug bites the dust!

fritz@unocss.UUCP (Tim Russell) (10/01/89)

Yow!  Two bugfixes in two days!  :-)

   This one has to do with EXTRACT/NOHEADER.  Geoff was writing out a
string to the output file, but assuming that it had been initialized with
the X-NEWS header thingy, but it wasn't initialized if the user used
/NOHEADER.  The result was an identical six or seven bytes of garbage at
the top of each extracted post.

-------------------------Begin patch to newsextract.c------------------------
*** newsextract.c;-1
--- newsextract.c
**************
*** 234,242
      }
    if (append_ofile) fprintf(fpextract,"\f\n");
    append_ofile = 1;
!   if (w_ok) sprintf(xfrbuf,"X-NEWS: %s %s: %d\n",
!                           news_node,ga[g]->grp_name,ga[g]->grp_ia[m].itm_num);
!   fputs(xfrbuf,fpextract);
    err_line(xfrbuf);
    if (m_seen) item_update(g,m);
    while (fgets(xfrbuf,510,fpr)) {
--- 234,244 -----
      }
    if (append_ofile) fprintf(fpextract,"\f\n");
    append_ofile = 1;
!   if (w_ok) {
!     sprintf(xfrbuf,"X-NEWS: %s %s: %d\n",
!                   news_node,ga[g]->grp_name,ga[g]->grp_ia[m].itm_num);
!     fputs(xfrbuf,fpextract);
!     }
    err_line(xfrbuf);
    if (m_seen) item_update(g,m);
    while (fgets(xfrbuf,510,fpr)) {
-------------------------------End of patch-----------------------------------

-- 
Tim Russell   Univ. Of Nebr. at Omaha   russell@{zeus.unl.edu | unoma1.bitnet}
"Don't try to have the last word; you might get it." - Robert A. Heinlein