From:	ADVAX::"mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM" "William H. Glass" 18-MAR-1991 22:33:52.54
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
CC:	
Subj:	Bug Collection (and fixes) for V6.0-3

Received: by ADVAX.DECnet (utk-mail11 v1.5) ; Mon, 18 Mar 91 22:32:25 EST
Received:  from mcnc by ge-dab.GE.COM (5.61/GE-DAB 1.15) with UUCP
	id AA01145 for ; Mon, 18 Mar 91 20:42:18 -0500
Received: from VM1.NoDak.EDU by mcnc.mcnc.org (5.59/MCNC/6-11-90)
	id AA15454; Sun, 17 Mar 91 20:46:25 -0500
	for ARISIA.DNET.ge.com!EVERHART
Message-Id: <9103180146.AA15454@mcnc.mcnc.org>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 5991; Sun, 17 Mar 91 19:44:37 CST
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 0433; Sun, 17 Mar 91 19:41:26 CST
Date:         Sun, 17 Mar 91 18:04:45 CST
Reply-To: "William H. Glass" <mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: "William H. Glass" <mcnc!VM1.NoDak.EDU!glass%VIXVAX.MGI.COM>
Subject:      Bug Collection (and fixes) for V6.0-3
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
 
   I just finished bringing up version 6.0-3 and encountered several
small problems and bugs along the way.  So, here's a collection of
the patches and their descriptions:
 
   1) NEWSADD - Fixed a typo in a character constant.  Put in an old
patch to eliminate the requirement for a space following the colon
in a header line.
 
   2) NEWSMENU - Fixed several bugs in the menu data structure where
the number of "buttons" was not correctly defined.  Added explanatory
text for the "Reply" button.  Changed the location of the initial
startup message so that it doesn't corrupt the "Newsmanager enabled"
message.  Changed "ESC" to "F11" since many keyboards have a separate ESC
key that is quite different from F11.
 
   3) NEWSPOST - Bob Sloane's recent patch to fix problem with default
distributions.
 
   4) NEWSREAD - Minor change to two array declarations.
 
   5) NEWSUTILITY - Changes a util_fromcpy to util_idcpy.  Used in getting
the message-id from an NNTP server.
 
   6) NNTP_SERVER - Fixed a declaration used when LEAVE_SPOOL_OPEN is
defined.  Included an old patch to eliminate requirement for a space
following the colon in a header line.  Fixed a bug in code for the new
LIST command that would cause server to die if an illegal LIST command
was received.
 
   7) NNTP_TCPCMU - Fixed bug that caused logging information to be written
out twice.
 
   8) SHUTDOWN - Included psldef.h.
 
   9) UNLOCKER - Included psldef.h.
 
   The following VMS SHARE file will produce the file GLASS-MAR17.DIFF which
contains all of the above patches.
 
   Bill Glass
 
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 17-MAR-1991 17:57:47.44   By user GLASS
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. GLASS-MAR17.DIFF;1
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X*** newsadd.c;1
X--- newsadd.c
X**************
X*** 831,837
X    int i;
X `20
X    while (*p != ':' && isprint(*p)) p++;
X!   if ((*p == ':') && (isspace(*(p+1)))) `7B
X      *p = '\0';
X      strcpy(h,s);
X      *p++ = ':';
X--- 832,838 -----
X    int i;
X `20
X    while (*p != ':' && isprint(*p)) p++;
X!   if (*p == ':') `7B
X      *p = '\0';
X      strcpy(h,s);
X      *p++ = ':';
X**************
X*** 950,956
X        do *(c - 1) = *c; while (*c++);
X        `7D
X      if (c = strchr(add_inline,'\n')) *c = '\0';
X!     if ((*add_inline == ' ') `7C`7C (*add_inline == '\'t')) `7B
X        if (scan_res) `7B
X          strcat(scanline,"\n");
X          append_line(scanline);
X--- 952,958 -----
X        do *(c - 1) = *c; while (*c++);
X        `7D
X      if (c = strchr(add_inline,'\n')) *c = '\0';
X!     if ((*add_inline == ' ') `7C`7C (*add_inline == '\t')) `7B
X        if (scan_res) `7B
X          strcat(scanline,"\n");
X          append_line(scanline);
X*** newsmenu.c;1
X--- newsmenu.c
X**************
X*** 227,233
X `20
X `20
X  `7B  /* other commands from level 1  MENU 6 */
X! `7B 7 `7D,`7B
X  "Quit"      , 0 , 'q'     , 0 ,           "QUIT" ,                -1 ,
X             "Finish using NEWS and do not keep a record of items read",`20
X  "sHell"         , 0  , 'h'    , 1 ,           ""        , 17   ,
X--- 227,233 -----
X `20
X `20
X  `7B  /* other commands from level 1  MENU 6 */
X! `7B 5 `7D,`7B
X  "Quit"      , 0 , 'q'     , 0 ,           "QUIT" ,                -1 ,
X             "Finish using NEWS and do not keep a record of items read",`20
X  "sHell"         , 0  , 'h'    , 1 ,           ""        , 17   ,
X**************
X*** 285,291
X  "Post"      , 0 , 'p'     , 0 ,           "POST/HEADER" ,                -
V1 ,
X             "Add an item to NEWS",`20
X  "Reply"      , 0 , 'r'     , 0 ,           "REPLY/HEADERS" ,             -
V1 ,
X!            " ."
X         `7D
X  `7D,  /*  add options for level 2    */`20
X  `0C
X--- 285,291 -----
X  "Post"      , 0 , 'p'     , 0 ,           "POST/HEADER" ,                -
V1 ,
X             "Add an item to NEWS",`20
X  "Reply"      , 0 , 'r'     , 0 ,           "REPLY/HEADERS" ,             -
V1 ,
X!            "Send EMAIL to the author of the current item"
X         `7D
X  `7D,  /*  add options for level 2    */`20
X  `0C
X**************
X*** 309,315
X `20
X `20
X  `7B  /* others options from level 2       MENU 11 */
X! `7B 9 `7D,`7B
X  "Clear"      , 0 , 'c'     , 0 ,           "" ,                12 ,
X             "Remove kill filters or marks `7B`7D",`20
X  "eXport"      , 0 , 'x'   , 1 ,           "" ,                8 ,
X--- 309,315 -----
X `20
X `20
X  `7B  /* others options from level 2       MENU 11 */
X! `7B 6 `7D,`7B
X  "Clear"      , 0 , 'c'     , 0 ,           "" ,                12 ,
X             "Remove kill filters or marks `7B`7D",`20
X  "eXport"      , 0 , 'x'   , 1 ,           "" ,                8 ,
X**************
X*** 394,400
X `20
X `20
X  `7B  /* others options from level 2       MENU 16 */
X! `7B 8 `7D,`7B
X  "Exit"      , 0 , 'e'     , 0 ,           "EXIT" ,           -1 ,
X             "Finish using NEWS",`20
X  "See"      , 0 ,  's'     , 0 ,           ""              ,  18 ,
X--- 394,400 -----
X `20
X `20
X  `7B  /* others options from level 2       MENU 16 */
X! `7B 9 `7D,`7B
X  "Exit"      , 0 , 'e'     , 0 ,           "EXIT" ,           -1 ,
X             "Finish using NEWS",`20
X  "See"      , 0 ,  's'     , 0 ,           ""              ,  18 ,
X**************
X*** 778,785
X `20
X  SMG$CREATE_VIRTUAL_DISPLAY( c$rfi(menu_rows) , c$rfi(devcol) ,`20
X                              &my_pb , 0 , 0 , 0 );
X! smg$put_chars( &trailer_vd , c$dsc("Waikato Menus - Press ESC at NEWS> pro
Vmpt"),
X!               c$rfi(3),c$rfi(40) );
X  `7D;
X  `0C
X `20
X--- 778,785 -----
X `20
X  SMG$CREATE_VIRTUAL_DISPLAY( c$rfi(menu_rows) , c$rfi(devcol) ,`20
X                              &my_pb , 0 , 0 , 0 );
X! smg$put_chars( &trailer_vd , c$dsc(" Waikato Menus - Press F11 at NEWS> pr
Vompt"),
X!               c$rfi(3),c$rfi(38) );
X  `7D;
X  `0C
X `20
X*** newspost.c;1
X--- newspost.c
X**************
X*** 412,418
X    int postfile, crosspost;
X  `7B
X    char ngroup`5B512`5D,
X!        post_dist`5B512`5D, post_path`5B512`5D,
X         s`5B512`5D,
X         infile`5B256`5D,
X         loc_id`5BIDLEN`5D,
X--- 412,418 -----
X    int postfile, crosspost;
X  `7B
X    char ngroup`5B512`5D,
X!        post_path`5B512`5D,
X         s`5B512`5D,
X         infile`5B256`5D,
X         loc_id`5BIDLEN`5D,
X**************
X*** 445,451
X    $DESCRIPTOR(infile_dsc,infile);
X `20
X    itm_approved = 0;
X!   *post_dist = *follow_groups = *followup_groups = *xnewsgroups = *xfollow
Vgroups = '\0';
X `20
X    if (crosspost) `7B
X      use_default = 1;
X--- 445,451 -----
X    $DESCRIPTOR(infile_dsc,infile);
X `20
X    itm_approved = 0;
X!   *follow_groups = *followup_groups = *xnewsgroups = *xfollowgroups = '\0'
V;
X `20
X    if (crosspost) `7B
X      use_default = 1;
X**************
X*** 1003,1009
X      if ((status & 1) && (usr_inp_l)) `7B
X        usr_inp`5Busr_inp_l`5D = '\0';
X        lower_case(usr_inp);
X!       strcpy(post_dist,usr_inp);
X        fprintf(fpw,"Distribution: %s\n",usr_inp);
X        `7D
X      `7D
X--- 1003,1009 -----
X      if ((status & 1) && (usr_inp_l)) `7B
X        usr_inp`5Busr_inp_l`5D = '\0';
X        lower_case(usr_inp);
X!       strcpy(distribution,usr_inp);
X        fprintf(fpw,"Distribution: %s\n",usr_inp);
X        `7D
X      `7D
X**************
X*** 1020,1026
X      `7D
X `20
X    clear_err_line();
X!   if (!sys_local_accept(ngroup,post_dist)) `7B
X      err_line("Post - Distribution of item not accepted by local news filte
Vr");
X      `7D
X    sprintf(err_oline,"Post to %s `5By`5D:",ngroup);
X--- 1020,1026 -----
X      `7D
X `20
X    clear_err_line();
X!   if (!sys_local_accept(ngroup,distribution)) `7B
X      err_line("Post - Distribution of item not accepted by local news filte
Vr");
X      `7D
X    sprintf(err_oline,"Post to %s `5By`5D:",ngroup);
X**************
X*** 1110,1116
X      net_news = 0;
X      auto_cre_grp = 1;
X      c$cks(1);
X!     if (!sys_local_accept(ngroup,post_dist))
X        err_line("Post - item NOT locally posted (filter rejection) - forwar
Vded");
X      else `7B
X        do_new_group(ngroup,1,cre_grp);
X--- 1111,1117 -----
X      net_news = 0;
X      auto_cre_grp = 1;
X      c$cks(1);
X!     if (!sys_local_accept(ngroup,distribution))
X        err_line("Post - item NOT locally posted (filter rejection) - forwar
Vded");
X      else `7B
X        do_new_group(ngroup,1,cre_grp);
X**************
X*** 1132,1138
X `20
X          /* check to see what else should be done with this posting */
X      if (forward_posting)
X!       sys_remote_send(post_path,ngroup,post_dist,Post_file,loc_id,0);
X      `7D
X `20
X      /* now look up news_manager:newspost.cc and then news_post_cc for more
X--- 1133,1139 -----
X `20
X          /* check to see what else should be done with this posting */
X      if (forward_posting)
X!       sys_remote_send(post_path,ngroup,distribution,Post_file,loc_id,0);
X      `7D
X `20
X      /* now look up news_manager:newspost.cc and then news_post_cc for more
X*** newsread.c;1
X--- newsread.c
X**************
X*** 768,774
X  int do_readprevstream(rheader,rot13)
X    int rheader, rot13;
X  `7B
X!   char title`5BSUBJLEN+1`5D, tmp_title`5BSUBJLEN+1`5D, *cp;
X    int i, unupd, s_i;
X    ITM_PTR iap;
X `20
X--- 769,775 -----
X  int do_readprevstream(rheader,rot13)
X    int rheader, rot13;
X  `7B
X!   char title`5BSUBJLEN`5D, tmp_title`5BSUBJLEN`5D, *cp;
X    int i, unupd, s_i;
X    ITM_PTR iap;
X `20
X*** newsutility.c;1
X--- newsutility.c
X**************
X*** 2093,2099
X                    lower_case(cp1);
X                    if (!strcmp(cp1,"subject")) util_subjcpy(newsitm.itm_tit
Vle,cp3);
X                    else if (!strcmp(cp1,"from")) util_fromcpy(newsitm.itm_f
Vrom,cp3);
X!                   else if (!strcmp(cp1,"message-id")) util_fromcpy(newsitm
V.itm_id,cp3);
X                    else if (!strcmp(cp1,"lines")) `7B
X                      if (sscanf(cp3,"%d",&(newsitm.itm_lines)) == 1)
X                        newsitm.itm_flags `7C= NEWS_M_LINESVALID;
X--- 2093,2099 -----
X                    lower_case(cp1);
X                    if (!strcmp(cp1,"subject")) util_subjcpy(newsitm.itm_tit
Vle,cp3);
X                    else if (!strcmp(cp1,"from")) util_fromcpy(newsitm.itm_f
Vrom,cp3);
X!                   else if (!strcmp(cp1,"message-id")) util_idcpy(newsitm.i
Vtm_id,cp3);
X                    else if (!strcmp(cp1,"lines")) `7B
X                      if (sscanf(cp3,"%d",&(newsitm.itm_lines)) == 1)
X                        newsitm.itm_flags `7C= NEWS_M_LINESVALID;
X*** nntp_server.c;1
X--- nntp_server.c
X**************
X*** 401,407
X      ihave_size = 0;
X `20
X  #if LEAVE_SPOOL_OPEN
X! int batch_size,
X `20
X  static
X  FILE *fpb = 0;
X--- 407,413 -----
X  int batch_size;
X  #else
X  #if LEAVE_SPOOL_OPEN
X! int batch_size;
X `20
X  static
X  FILE *fpb = 0;
X**************
X*** 576,582
X    while (*p != ':' && isprint(*p)) p++;
X    if (*p != ':') return(0);
X    if (!*(p+1)) return(1);
X-   if (!isspace(*(p+1))) return(0);
X `20
X    *p = '\0';
X    strcpy(h,s);
X--- 583,588 -----
X    while (*p != ':' && isprint(*p)) p++;
X    if (*p != ':') return(0);
X    if (!*(p+1)) return(1);
X `20
X    *p = '\0';
X    strcpy(h,s);
X**************
X*** 2638,2644
X      if (!strcmp(argv`5B1`5D,"active")) list_sw = 1;
X      else if (!strcmp(argv`5B1`5D,"newsgroups")) list_sw = 2;
X      else if (!strcmp(argv`5B1`5D,"distributions"))list_sw = 3;
X!     else return(write_net(msg`5B501`5D,stm));
X      `7D
X    if (list_sw == 3) `7B
X      FILE *fpr;
X--- 2669,2675 -----
X      if (!strcmp(argv`5B1`5D,"active")) list_sw = 1;
X      else if (!strcmp(argv`5B1`5D,"newsgroups")) list_sw = 2;
X      else if (!strcmp(argv`5B1`5D,"distributions"))list_sw = 3;
X!     else return(write_net(msg`5BM501`5D,stm));
X      `7D
X    if (list_sw == 3) `7B
X      FILE *fpr;
X*** nntp_tcpcmu.c;1
X--- nntp_tcpcmu.c
X**************
X*** 321,327
X  #endif
X    if (!logged) log_to_file(1);`20
X    sys$cancel(f);
X-   log_to_file(1);
X    cks(sys$qiow(0,f,IO$_DELETE,iosb,0,0,0,0,0,0,0,0));
X    cks(*i_o_sts);
X    sys$dassgn(f);
X--- 321,326 -----
X  #endif
X    if (!logged) log_to_file(1);`20
X    sys$cancel(f);
X    cks(sys$qiow(0,f,IO$_DELETE,iosb,0,0,0,0,0,0,0,0));
X    cks(*i_o_sts);
X    sys$dassgn(f);
X*** shutdown.c;1
X--- shutdown.c
X**************
X*** 22,27
X  #define LOCKNAME "NEWS_LOCK"
X  #include descrip
X  #include lckdef
X `20
X  typedef volatile struct `7B
X     int lksb_l_status;
X--- 22,28 -----
X  #define LOCKNAME "NEWS_LOCK"
X  #include descrip
X  #include lckdef
X+ #include psldef
X `20
X  typedef volatile struct `7B
X     int lksb_l_status;
X*** unlocker.c;1
X--- unlocker.c
X**************
X*** 7,12
X  #define LOCKNAME "NEWS_LOCK"
X  #include descrip
X  #include lckdef
X `20
X  typedef volatile struct `7B
X     int lksb_l_status;
X--- 7,13 -----
X  #define LOCKNAME "NEWS_LOCK"
X  #include descrip
X  #include lckdef
X+ #include psldef
X `20
X  typedef volatile struct `7B
X     int lksb_l_status;
$ CALL UNPACK GLASS-MAR17.DIFF;1 688597321
$ v=f$verify(v)
$ EXIT
