From:	AITGW::"dunnett@MALA.BC.CA" "Malcolm Dunnett"  7-JAN-1992 21:59:41.94
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>
CC:	
Subj:	MARK/UNMARK problem in 6.0-3

Received: by AITGW.DECnet (utk-mail11 v1.5) ; Tue, 7 Jan 92 21:56:24 EST
Received: from vm1.NoDak.edu by aitgw.ge.com (5.65/GE Gateway 1.4)
	id AA03102; Tue, 7 Jan 92 21:56:06 -0500
Message-Id: <9201080256.AA03102@aitgw.ge.com>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP V2R2)
   with BSMTP id 3062; Tue, 07 Jan 92 20:56:09 CST
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 3018; Tue, 07 Jan 92 20:56:06 CST
Date:         Tue, 7 Jan 1992 17:48:59 GMT
Reply-To: Malcolm Dunnett <dunnett@MALA.BC.CA>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: Malcolm Dunnett <dunnett@MALA.BC.CA>
Subject:      MARK/UNMARK problem in 6.0-3
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>
 
Sorry if this has already been discussed, I'm new here:
 
  I found a problem with the MARK and UNMARK commands in ANU NEWS V6.0-3.
They would not mark items, the routines reported "no item specified"
regardless of the input. I traced this to 2 problems in NEWSRC.C:
 
   1.) the wrong variable was being incremented in the mark/unmark loop
 
   2.) the routine "getnoterange()" apparently returns a "last item" value
       of 0 if the first and last items specified are the same, the
       mark/unmark routines couldn't deal with this ( I don't know if
       this 0 return is legit other places so I didn't care to mess with
       it, I changed the mark routines to deal with it instead ) .
 
Attached is an annotated DIFF listing of the changes made to NEWSRC.C
 
==================================================================
Malcolm Dunnett                        <dunnett@mala.bc.ca>
Malaspina College
900 Fifth Street
Nanaimo, B.C. CANADA                   Tel: (604)755-8738
V9R 5S5
==================================================================
 
[ANUNEWS.SAVE]NEWSRC.C is the original ( from the distribution kit )
 
[ANUNEWS.NEWS_SRC]NEWSRC.C is the modified module
 
!       MARK routine
!
!       CHANGES:
!
!       add a variable k which will be used as the "end of loop" test
!
 
************
File MALIN1$DUA0:[ANUNEWS.SAVE]NEWSRC.C;141
 1105     int sg, si, i, j, count = 0;
 1106     char tag[80];
******
File MALIN1$DUA0:[ANUNEWS.NEWS_SRC]NEWSRC.C;147
 1105     int sg, si, i, j, k, count = 0;
 1106     char tag[80];
************
 
!       CHANGES:
!
!       set k = d_item[j].litm if non 0 , otherwise use d_item[j].fitm
!       increment i inside this loop, not j
!
 
************
File MALIN1$DUA0:[ANUNEWS.SAVE]NEWSRC.C;141
 1125         for (i = d_itm[j].fitm ; i <= d_itm[j].litm; ++j) {
 1126           mark_set(ga[sg]->grp_num,i,tag);
******
File MALIN1$DUA0:[ANUNEWS.NEWS_SRC]NEWSRC.C;147
 1125         if (!(k = d_itm[j].litm)) k = d_itm[j].fitm;
 1126         for (i = d_itm[j].fitm ; i <= k; ++i) {
 1127           mark_set(ga[sg]->grp_num,i,tag);
************
!
!       UNMARK routine (As above)
!
 
!       CHANGES:
!
!       add a variable k which will be used as the "end of loop" test
!
 
************
File MALIN1$DUA0:[ANUNEWS.SAVE]NEWSRC.C;141
 1154     int sg, si, i, j, count = 0;
 1155     char tag[80], *tag_param = 0;
******
File MALIN1$DUA0:[ANUNEWS.NEWS_SRC]NEWSRC.C;147
 1155     int sg, si, i, j, k, count = 0;
 1156     char tag[80], *tag_param = 0;
************
!       CHANGES:
!
!       set k = d_item[j].litm if non 0 , otherwise use d_item[j].fitm
!       increment i inside this loop, not j
!
 
************
File MALIN1$DUA0:[ANUNEWS.SAVE]NEWSRC.C;141
 1177         for (i = d_itm[j].fitm ; i <= d_itm[j].litm; ++j) {
 1178           mark_del(ga[sg]->grp_num,i,tag_param);
******
File MALIN1$DUA0:[ANUNEWS.NEWS_SRC]NEWSRC.C;147
 1178         if (!(k = d_itm[j].litm)) k = d_itm[j].fitm;
 1179         for (i = d_itm[j].fitm ; i <= k; ++i) {
 1180           mark_del(ga[sg]->grp_num,i,tag_param);
************
 
Number of difference sections found: 4
Number of difference records found: 6
 
DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=MALIN1$DUA0:[ANUNEWS.SAVE]D.LIS;1-
    MALIN1$DUA0:[ANUNEWS.SAVE]NEWSRC.C;141-
    MALIN1$DUA0:[ANUNEWS.NEWS_SRC]NEWSRC.C;147
