Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!lwall From: lwall@sdcrdcf.UUCP (Larry Wall) Newsgroups: net.news.b,net.sources.bugs Subject: rn 4.3 patch #32 Message-ID: <3396@sdcrdcf.UUCP> Date: Fri, 31-Oct-86 18:43:12 EST Article-I.D.: sdcrdcf.3396 Posted: Fri Oct 31 18:43:12 1986 Date-Received: Mon, 3-Nov-86 22:43:36 EST Organization: System Development Corporation R&D, Santa Monica Lines: 389 Xref: mnetor net.news.b:398 net.sources.bugs:870 System: rn version 4.3 Patch #: 32 Priority: MEDIUM to HIGH, depending on how many KILL files you use Subject: KILL on newly arrived articles can accidentally mark articles read From: tonyb@tektronix.com (Tony Birnseth) Description: Under certain circumstances, if an article arrives in a newsgroup while you are in that newsgroup, and there is a KILL file for that newgroup, articles can accidentally be marked as read. Repeat-by: Go to the last article in a newsgroup. Then ^K to edit the KILL file to change the THRU number to, say, 10 less than the current number (to get rid on any articles of that subject the next time the kill file is run). Do a followup to the last article. After the followup, the user is told "End of newsgroup...". If the user types 'space' or 'n', rn will proceed to run the kill file on the new article that has arrived. Unfortunately, all articles between the THRU number in the KILL file and new article will be marked as read. This may not be true. Fix: From rn, say "| patch -d DIR", where DIR is your rn source directory. Outside of rn, say "cd DIR; patch Patch #: 32 Index: bits.c Prereq: 4.3.1.3 *** bits.c.old Fri Oct 31 15:27:01 1986 --- bits.c Fri Oct 31 15:27:17 1986 *************** *** 1,4 ! /* $Header: bits.c,v 4.3.1.3 86/09/09 16:01:43 lwall Exp $ * * $Log: bits.c,v $ * Revision 4.3.1.3 86/09/09 16:01:43 lwall --- 1,4 ----- ! /* $Header: bits.c,v 4.3.1.4 86/10/31 15:23:53 lwall Exp $ * * $Log: bits.c,v $ * Revision 4.3.1.4 86/10/31 15:23:53 lwall *************** *** 1,6 /* $Header: bits.c,v 4.3.1.3 86/09/09 16:01:43 lwall Exp $ * * $Log: bits.c,v $ * Revision 4.3.1.3 86/09/09 16:01:43 lwall * Fixed 'n more articles' bug. * --- 1,10 ----- /* $Header: bits.c,v 4.3.1.4 86/10/31 15:23:53 lwall Exp $ * * $Log: bits.c,v $ + * Revision 4.3.1.4 86/10/31 15:23:53 lwall + * Separated firstart into two variables so KILL on new articles won't + * accidentally mark articles read. + * * Revision 4.3.1.3 86/09/09 16:01:43 lwall * Fixed 'n more articles' bug. * *************** *** 162,169 ART_NUM artnum; { #ifdef DEBUGGING ! if (debug && artnum < firstart) { ! printf("onemore: %d < %d\n",artnum,firstart) FLUSH; return; } #endif --- 166,173 ----- ART_NUM artnum; { #ifdef DEBUGGING ! if (debug && artnum < firstbit) { ! printf("onemore: %d < %d\n",artnum,firstbit) FLUSH; return; } #endif *************** *** 180,187 ART_NUM artnum; { #ifdef DEBUGGING ! if (debug && artnum < firstart) { ! printf("oneless: %d < %d\n",artnum,firstart) FLUSH; return; } #endif --- 184,191 ----- ART_NUM artnum; { #ifdef DEBUGGING ! if (debug && artnum < firstbit) { ! printf("oneless: %d < %d\n",artnum,firstbit) FLUSH; return; } #endif *************** *** 192,198 } } ! /* mark an article as unread, making sure that firstart is properly handled */ /* cross-references are left as read in the other newsgroups */ void --- 196,202 ----- } } ! /* mark an article as unread, making sure that firstbit is properly handled */ /* cross-references are left as read in the other newsgroups */ void *************** *** 240,246 chase_xrefs(artnum,TRUE); } ! /* make sure we have bits set correctly down to firstart */ void check_first(min) --- 244,250 ----- chase_xrefs(artnum,TRUE); } ! /* make sure we have bits set correctly down to firstbit */ void check_first(min) *************** *** 246,252 check_first(min) ART_NUM min; { ! register ART_NUM i = firstart; if (min < absfirst) min = absfirst; --- 250,256 ----- check_first(min) ART_NUM min; { ! register ART_NUM i = firstbit; if (min < absfirst) min = absfirst; *************** *** 253,259 if (min < i) { for (i--; i>=min; i--) ctl_set(i); /* mark as read */ ! firstart = min; } } --- 257,263 ----- if (min < i) { for (i--; i>=min; i--) ctl_set(i); /* mark as read */ ! firstart = firstbit = min; } } *************** *** 508,514 mybuf[i] = '\0'; s = mybuf; /* initialize the for loop below */ if (strnEQ(s,"1-",2)) { /* can we save some time here? */ ! firstart = atol(s+2)+1; /* ignore first range thusly */ s=index(s,',') + 1; } else --- 512,518 ----- mybuf[i] = '\0'; s = mybuf; /* initialize the for loop below */ if (strnEQ(s,"1-",2)) { /* can we save some time here? */ ! firstbit = atol(s+2)+1; /* ignore first range thusly */ s=index(s,',') + 1; } else *************** *** 512,520 s=index(s,',') + 1; } else ! firstart = 1; /* all the bits are valid for now */ ! if (absfirst > firstart) { /* do we know already? */ ! firstart = absfirst; /* no point calling getngmin again */ } else if (artopen(firstart) == Nullfp) { /* first unread article missing? */ --- 516,524 ----- s=index(s,',') + 1; } else ! firstbit = 1; /* all the bits are valid for now */ ! if (absfirst > firstbit) { /* do we know already? */ ! firstbit = absfirst; /* no point calling getngmin again */ } else if (artopen(firstbit) == Nullfp) { /* first unread article missing? */ *************** *** 516,522 if (absfirst > firstart) { /* do we know already? */ firstart = absfirst; /* no point calling getngmin again */ } ! else if (artopen(firstart) == Nullfp) { /* first unread article missing? */ i = getngmin(".",firstart); /* see if expire has been busy */ if (i) { /* avoid a bunch of extra opens */ --- 520,526 ----- if (absfirst > firstbit) { /* do we know already? */ firstbit = absfirst; /* no point calling getngmin again */ } ! else if (artopen(firstbit) == Nullfp) { /* first unread article missing? */ i = getngmin(".",firstbit); /* see if expire has been busy */ if (i) { /* avoid a bunch of extra opens */ *************** *** 518,524 } else if (artopen(firstart) == Nullfp) { /* first unread article missing? */ ! i = getngmin(".",firstart); /* see if expire has been busy */ if (i) { /* avoid a bunch of extra opens */ firstart = i; } --- 522,528 ----- } else if (artopen(firstbit) == Nullfp) { /* first unread article missing? */ ! i = getngmin(".",firstbit); /* see if expire has been busy */ if (i) { /* avoid a bunch of extra opens */ firstbit = i; } *************** *** 520,526 /* first unread article missing? */ i = getngmin(".",firstart); /* see if expire has been busy */ if (i) { /* avoid a bunch of extra opens */ ! firstart = i; } } #ifdef PENDING --- 524,530 ----- /* first unread article missing? */ i = getngmin(".",firstbit); /* see if expire has been busy */ if (i) { /* avoid a bunch of extra opens */ ! firstbit = i; } } firstart = firstbit; /* firstart > firstbit in KILL */ *************** *** 523,528 firstart = i; } } #ifdef PENDING # ifdef CACHESUBJ subj_to_get = firstart; --- 527,533 ----- firstbit = i; } } + firstart = firstbit; /* firstart > firstbit in KILL */ #ifdef PENDING # ifdef CACHESUBJ subj_to_get = firstbit; *************** *** 525,531 } #ifdef PENDING # ifdef CACHESUBJ ! subj_to_get = firstart; # endif #endif unread = lastart - firstart + 1; /* assume this range unread */ --- 530,536 ----- firstart = firstbit; /* firstart > firstbit in KILL */ #ifdef PENDING # ifdef CACHESUBJ ! subj_to_get = firstbit; # endif #endif unread = lastart - firstbit + 1; /* assume this range unread */ *************** *** 528,535 subj_to_get = firstart; # endif #endif ! unread = lastart - firstart + 1; /* assume this range unread */ ! for (i=OFFSET(firstart)/BITSPERBYTE; i lastart) max = lastart; if (min <= max) /* non-null range? */ --- 552,559 ----- if ((h = index(s,'-')) != Nullch) { /* is there a -? */ min = atol(s); max = atol(h+1); ! if (min < firstbit) /* make sure range is in range */ ! min = firstbit; if (max > lastart) max = lastart; if (min <= max) /* non-null range? */ *************** *** 556,562 for (i=min; i<=max; i++) /* for all articles in range */ ctl_set(i); /* mark them read */ } ! else if ((i = atol(s)) >= firstart && i <= lastart) { /* is single number reasonable? */ ctl_set(i); /* mark it read */ unread--; /* decrement articles to read */ --- 561,567 ----- for (i=min; i<=max; i++) /* for all articles in range */ ctl_set(i); /* mark them read */ } ! else if ((i = atol(s)) >= firstbit && i <= lastart) { /* is single number reasonable? */ ctl_set(i); /* mark it read */ unread--; /* decrement articles to read */