From:	MERC::"uunet!VM1.NODAK.EDU!OWNER-ANU-NEWS" 10-MAR-1993 09:19:23.82
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>
CC:	
Subj:	NewsRC.C patch: adds NewsRC_LocalDB.Template

ANU News Patch
Patch ID: 921223_newsrc.c!bailey@genetics.upenn.edu
Date: 23-Dec-1992
Author: Charles Bailey   bailey@genetics.upenn.edu
News Version: 6.1beta5
News Files: NewsRC.C
Description: Searches for separate News_Manager:NewsRC_LocalDB.Template file
for local database if current session is using local database and
News_Manager:NewsRC.Template does not exist or is for NNTP client.
*** newsrc.c;
--- newsrc_new.c
**************
*** 27,33
  **    - replace `bad_file = ferror(newsrc) | fclose(newsrc);' error check;
  **      `|' doesn't guarantee order of operation like `||' and gcc causes
  **      the fclose to execute before the ferror, resulting in an ACCVIO.
!
  **--
  **/










--- 27,35 -----
  **    - replace `bad_file = ferror(newsrc) | fclose(newsrc);' error check;
  **      `|' doesn't guarantee order of operation like `||' and gcc causes
  **      the fclose to execute before the ferror, resulting in an ACCVIO.
! **    V6.1b5  23-Dec-1992     bailey@genetics.upenn.edu
! **  - use News_Manager:NewsRC_LocalDB.Template if NewsRC.Template is for
! **    NNTP client and current session is using local database
  **--
  **/










**************
*** 163,168
        delete_file_versions("SYS$LOGIN:NEWS_GROUPS.REGISTER");
          }
        else {
          sysprv();
          if (!(newsrc = fopen("NEWS_MANAGER:NEWSRC.TEMPLATE","r","mbc=40"))) {
            nosysprv();
--- 165,173 -----
        delete_file_versions("SYS$LOGIN:NEWS_GROUPS.REGISTER");
          }
        else {
+ /* Modified code to look for separate template file for local database if
+    !nntp_client and News_Manager:NewsRC.Template does not exist or is for
+    nntp client.  11-OCT-1992  C. Bailey  bailey@hmivax.humgen.upenn.edu  */
          sysprv();
          if (!(newsrc = fopen("NEWS_MANAGER:NEWSRC.TEMPLATE","r","mbc=40"))) {
            if (!nntp_client &&
**************
*** 165,173
        else {
          sysprv();
          if (!(newsrc = fopen("NEWS_MANAGER:NEWSRC.TEMPLATE","r","mbc=40"))) {
!           nosysprv();
!           free(ca);
!           return(0);
            }
          first_time_user = 1;
          nosysprv();
--- 170,197 -----
     nntp client.  11-OCT-1992  C. Bailey  bailey@hmivax.humgen.upenn.edu  */
          sysprv();
          if (!(newsrc = fopen("NEWS_MANAGER:NEWSRC.TEMPLATE","r","mbc=40"))) {
!           if (!nntp_client &&
!               (newsrc = fopen("NEWS_MANAGER:NEWSRC_LOCALDB.TEMPLATE","r",
!                               "mbc=40"))) ; /* skip over free-and-return */
!           else {
!             nosysprv();
!             free(ca);
!             return(0);
!             }
!           }
!         if (!nntp_client) {
!           if ((in_line = fgetl(newsrc))) {
!             if (*in_line == '~') {
!               fclose(newsrc);
!               if (!(newsrc = fopen("NEWS_MANAGER:NEWSRC_LOCALDB.TEMPLATE","r",
!                                    "mbc=40"))) {
!                 nosysprv();
!                 free(ca);
!                 return(0);
!                 }
!               }
!             else rewind(newsrc);
!             }
            }
          first_time_user = 1;
          nosysprv();
*** patchlist.h;-1
--- patchlist.h
**************
*** 1,1
  =+=+= End =+=+=
--- 1,2 -----
+ 921223_newsrc!bailey@genetics.upenn.edu
  =+=+= End =+=+=
