home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume1 / rn / patch32 < prev    next >
Text File  |  1986-11-30  |  11KB  |  403 lines

  1. Article 645 of net.sources.bugs:
  2. Path: adelie!ll-xn!nike!sri-spam!sri-unix!hplabs!sdcrdcf!lwall
  3. From: lwall@sdcrdcf.UUCP (Larry Wall)
  4. Newsgroups: net.news.b,net.sources.bugs
  5. Subject: rn 4.3 patch #32
  6. Message-ID: <3396@sdcrdcf.UUCP>
  7. Date: 31 Oct 86 23:43:12 GMT
  8. Organization: System Development Corporation R&D, Santa Monica
  9. Lines: 389
  10. Xref: adelie net.news.b:294 net.sources.bugs:645
  11.  
  12. System: rn version 4.3
  13. Patch #: 32
  14. Priority: MEDIUM to HIGH, depending on how many KILL files you use
  15. Subject: KILL on newly arrived articles can accidentally mark articles read
  16. From: tonyb@tektronix.com (Tony Birnseth)
  17.  
  18. Description:
  19.     Under certain circumstances, if an article arrives in a newsgroup
  20.     while you are in that newsgroup, and there is a KILL file for that
  21.     newgroup, articles can accidentally be marked as read.
  22.  
  23. Repeat-by:
  24.     Go to the last article in a newsgroup.  Then ^K to edit the KILL 
  25.     file to change the THRU number to, say, 10 less than the current 
  26.     number (to get rid on any articles of that subject the next time 
  27.     the kill file is run).  Do a followup to the last article. 
  28.     After the followup, the user is told "End of newsgroup...".  If 
  29.     the user types 'space' or 'n', rn will proceed to run the kill file
  30.     on the new article that has arrived.  Unfortunately, all articles
  31.     between the THRU number in the KILL file and new article will be 
  32.     marked as read.  This may not be true.
  33.  
  34. Fix:    From rn, say "| patch -d DIR", where DIR is your rn source directory.
  35.     Outside of rn, say "cd DIR; patch <thisarticle".  If you don't have
  36.     the patch program, apply the following by hand, or get patch.
  37.  
  38.     If patch indicates that patchlevel is the wrong version, you may need
  39.     to apply one or more previous patches, or the patch may already
  40.     have been applied.  See the patchlevel file to find out what has or
  41.     has not been applied.  In any event, don't continue with the patch.
  42.  
  43.     If you are missing previous patches they can be obtained from me:
  44.  
  45.     Larry Wall
  46.     {allegra,burdvax,cbosgd,hplabs,ihnp4,sdcsvax}!sdcrdcf!lwall
  47.  
  48.     If you send a mail message of the following form it will greatly speed
  49.     processing:
  50.  
  51.     Subject: Command
  52.     @SH mailpatch PATH rn 4.3 NUM ...
  53.  
  54.     where PATH is a return path FROM ME TO YOU in bang notation, and NUM
  55.     is the number of one or more patches you need, separated by spaces.
  56.     Yes, I've installed MEP.  And yes, I changed it so you can't break
  57.     security here.  So don't try.
  58.  
  59. Index: patchlevel
  60. Prereq: 31
  61. 1c1
  62. < Patch #: 31
  63. ---
  64. > Patch #: 32
  65.  
  66. Index: bits.c
  67. Prereq: 4.3.1.3
  68. *** bits.c.old    Fri Oct 31 15:27:01 1986
  69. --- bits.c    Fri Oct 31 15:27:17 1986
  70. ***************
  71. *** 1,4
  72. ! /* $Header: bits.c,v 4.3.1.3 86/09/09 16:01:43 lwall Exp $
  73.    *
  74.    * $Log:    bits.c,v $
  75.    * Revision 4.3.1.3  86/09/09  16:01:43  lwall
  76.  
  77. --- 1,4 -----
  78. ! /* $Header: bits.c,v 4.3.1.4 86/10/31 15:23:53 lwall Exp $
  79.    *
  80.    * $Log:    bits.c,v $
  81.    * Revision 4.3.1.4  86/10/31  15:23:53  lwall
  82. ***************
  83. *** 1,6
  84.   /* $Header: bits.c,v 4.3.1.3 86/09/09 16:01:43 lwall Exp $
  85.    *
  86.    * $Log:    bits.c,v $
  87.    * Revision 4.3.1.3  86/09/09  16:01:43  lwall
  88.    * Fixed 'n more articles' bug.
  89.    * 
  90.  
  91. --- 1,10 -----
  92.   /* $Header: bits.c,v 4.3.1.4 86/10/31 15:23:53 lwall Exp $
  93.    *
  94.    * $Log:    bits.c,v $
  95. +  * Revision 4.3.1.4  86/10/31  15:23:53  lwall
  96. +  * Separated firstart into two variables so KILL on new articles won't
  97. +  * accidentally mark articles read.
  98. +  * 
  99.    * Revision 4.3.1.3  86/09/09  16:01:43  lwall
  100.    * Fixed 'n more articles' bug.
  101.    * 
  102. ***************
  103. *** 162,169
  104.   ART_NUM artnum;
  105.   {
  106.   #ifdef DEBUGGING
  107. !     if (debug && artnum < firstart) {
  108. !     printf("onemore: %d < %d\n",artnum,firstart) FLUSH;
  109.       return;
  110.       }
  111.   #endif
  112.  
  113. --- 166,173 -----
  114.   ART_NUM artnum;
  115.   {
  116.   #ifdef DEBUGGING
  117. !     if (debug && artnum < firstbit) {
  118. !     printf("onemore: %d < %d\n",artnum,firstbit) FLUSH;
  119.       return;
  120.       }
  121.   #endif
  122. ***************
  123. *** 180,187
  124.   ART_NUM artnum;
  125.   {
  126.   #ifdef DEBUGGING
  127. !     if (debug && artnum < firstart) {
  128. !     printf("oneless: %d < %d\n",artnum,firstart) FLUSH;
  129.       return;
  130.       }
  131.   #endif
  132.  
  133. --- 184,191 -----
  134.   ART_NUM artnum;
  135.   {
  136.   #ifdef DEBUGGING
  137. !     if (debug && artnum < firstbit) {
  138. !     printf("oneless: %d < %d\n",artnum,firstbit) FLUSH;
  139.       return;
  140.       }
  141.   #endif
  142. ***************
  143. *** 192,198
  144.       }
  145.   }
  146.   
  147. ! /* mark an article as unread, making sure that firstart is properly handled */
  148.   /* cross-references are left as read in the other newsgroups */
  149.   
  150.   void
  151.  
  152. --- 196,202 -----
  153.       }
  154.   }
  155.   
  156. ! /* mark an article as unread, making sure that firstbit is properly handled */
  157.   /* cross-references are left as read in the other newsgroups */
  158.   
  159.   void
  160. ***************
  161. *** 240,246
  162.       chase_xrefs(artnum,TRUE);
  163.   }
  164.   
  165. ! /* make sure we have bits set correctly down to firstart */
  166.   
  167.   void
  168.   check_first(min)
  169.  
  170. --- 244,250 -----
  171.       chase_xrefs(artnum,TRUE);
  172.   }
  173.   
  174. ! /* make sure we have bits set correctly down to firstbit */
  175.   
  176.   void
  177.   check_first(min)
  178. ***************
  179. *** 246,252
  180.   check_first(min)
  181.   ART_NUM min;
  182.   {
  183. !     register ART_NUM i = firstart;
  184.   
  185.       if (min < absfirst)
  186.       min = absfirst;
  187.  
  188. --- 250,256 -----
  189.   check_first(min)
  190.   ART_NUM min;
  191.   {
  192. !     register ART_NUM i = firstbit;
  193.   
  194.       if (min < absfirst)
  195.       min = absfirst;
  196. ***************
  197. *** 253,259
  198.       if (min < i) {
  199.       for (i--; i>=min; i--)
  200.           ctl_set(i);        /* mark as read */
  201. !     firstart = min;
  202.       }
  203.   }
  204.   
  205.  
  206. --- 257,263 -----
  207.       if (min < i) {
  208.       for (i--; i>=min; i--)
  209.           ctl_set(i);        /* mark as read */
  210. !     firstart = firstbit = min;
  211.       }
  212.   }
  213.   
  214. ***************
  215. *** 508,514
  216.       mybuf[i] = '\0';
  217.       s = mybuf;                /* initialize the for loop below */
  218.       if (strnEQ(s,"1-",2)) {        /* can we save some time here? */
  219. !     firstart = atol(s+2)+1;        /* ignore first range thusly */
  220.       s=index(s,',') + 1;
  221.       }
  222.       else
  223.  
  224. --- 512,518 -----
  225.       mybuf[i] = '\0';
  226.       s = mybuf;                /* initialize the for loop below */
  227.       if (strnEQ(s,"1-",2)) {        /* can we save some time here? */
  228. !     firstbit = atol(s+2)+1;        /* ignore first range thusly */
  229.       s=index(s,',') + 1;
  230.       }
  231.       else
  232. ***************
  233. *** 512,520
  234.       s=index(s,',') + 1;
  235.       }
  236.       else
  237. !     firstart = 1;            /* all the bits are valid for now */
  238. !     if (absfirst > firstart) {        /* do we know already? */
  239. !     firstart = absfirst;        /* no point calling getngmin again */
  240.       }
  241.       else if (artopen(firstart) == Nullfp) {
  242.                       /* first unread article missing? */
  243.  
  244. --- 516,524 -----
  245.       s=index(s,',') + 1;
  246.       }
  247.       else
  248. !     firstbit = 1;            /* all the bits are valid for now */
  249. !     if (absfirst > firstbit) {        /* do we know already? */
  250. !     firstbit = absfirst;        /* no point calling getngmin again */
  251.       }
  252.       else if (artopen(firstbit) == Nullfp) {
  253.                       /* first unread article missing? */
  254. ***************
  255. *** 516,522
  256.       if (absfirst > firstart) {        /* do we know already? */
  257.       firstart = absfirst;        /* no point calling getngmin again */
  258.       }
  259. !     else if (artopen(firstart) == Nullfp) {
  260.                       /* first unread article missing? */
  261.       i = getngmin(".",firstart);    /* see if expire has been busy */
  262.       if (i) {            /* avoid a bunch of extra opens */
  263.  
  264. --- 520,526 -----
  265.       if (absfirst > firstbit) {        /* do we know already? */
  266.       firstbit = absfirst;        /* no point calling getngmin again */
  267.       }
  268. !     else if (artopen(firstbit) == Nullfp) {
  269.                       /* first unread article missing? */
  270.       i = getngmin(".",firstbit);    /* see if expire has been busy */
  271.       if (i) {            /* avoid a bunch of extra opens */
  272. ***************
  273. *** 518,524
  274.       }
  275.       else if (artopen(firstart) == Nullfp) {
  276.                       /* first unread article missing? */
  277. !     i = getngmin(".",firstart);    /* see if expire has been busy */
  278.       if (i) {            /* avoid a bunch of extra opens */
  279.           firstart = i;
  280.       }
  281.  
  282. --- 522,528 -----
  283.       }
  284.       else if (artopen(firstbit) == Nullfp) {
  285.                       /* first unread article missing? */
  286. !     i = getngmin(".",firstbit);    /* see if expire has been busy */
  287.       if (i) {            /* avoid a bunch of extra opens */
  288.           firstbit = i;
  289.       }
  290. ***************
  291. *** 520,526
  292.                       /* first unread article missing? */
  293.       i = getngmin(".",firstart);    /* see if expire has been busy */
  294.       if (i) {            /* avoid a bunch of extra opens */
  295. !         firstart = i;
  296.       }
  297.       }
  298.   #ifdef PENDING
  299.  
  300. --- 524,530 -----
  301.                       /* first unread article missing? */
  302.       i = getngmin(".",firstbit);    /* see if expire has been busy */
  303.       if (i) {            /* avoid a bunch of extra opens */
  304. !         firstbit = i;
  305.       }
  306.       }
  307.       firstart = firstbit;        /* firstart > firstbit in KILL */
  308. ***************
  309. *** 523,528
  310.           firstart = i;
  311.       }
  312.       }
  313.   #ifdef PENDING
  314.   #   ifdef CACHESUBJ
  315.       subj_to_get = firstart;
  316.  
  317. --- 527,533 -----
  318.           firstbit = i;
  319.       }
  320.       }
  321. +     firstart = firstbit;        /* firstart > firstbit in KILL */
  322.   #ifdef PENDING
  323.   #   ifdef CACHESUBJ
  324.       subj_to_get = firstbit;
  325. ***************
  326. *** 525,531
  327.       }
  328.   #ifdef PENDING
  329.   #   ifdef CACHESUBJ
  330. !     subj_to_get = firstart;
  331.   #   endif
  332.   #endif
  333.       unread = lastart - firstart + 1;    /* assume this range unread */
  334.  
  335. --- 530,536 -----
  336.       firstart = firstbit;        /* firstart > firstbit in KILL */
  337.   #ifdef PENDING
  338.   #   ifdef CACHESUBJ
  339. !     subj_to_get = firstbit;
  340.   #   endif
  341.   #endif
  342.       unread = lastart - firstbit + 1;    /* assume this range unread */
  343. ***************
  344. *** 528,535
  345.       subj_to_get = firstart;
  346.   #   endif
  347.   #endif
  348. !     unread = lastart - firstart + 1;    /* assume this range unread */
  349. !     for (i=OFFSET(firstart)/BITSPERBYTE; i<ctlsize; i++)
  350.       ctlarea[i] = 0;            /* assume unread */
  351.   #ifdef DEBUGGING
  352.       if (debug & DEB_CTLAREA_BITMAP) {
  353.  
  354. --- 533,540 -----
  355.       subj_to_get = firstbit;
  356.   #   endif
  357.   #endif
  358. !     unread = lastart - firstbit + 1;    /* assume this range unread */
  359. !     for (i=OFFSET(firstbit)/BITSPERBYTE; i<ctlsize; i++)
  360.       ctlarea[i] = 0;            /* assume unread */
  361.   #ifdef DEBUGGING
  362.       if (debug & DEB_CTLAREA_BITMAP) {
  363. ***************
  364. *** 547,554
  365.       if ((h = index(s,'-')) != Nullch) {    /* is there a -? */
  366.           min = atol(s);
  367.           max = atol(h+1);
  368. !         if (min < firstart)        /* make sure range is in range */
  369. !         min = firstart;
  370.           if (max > lastart)
  371.           max = lastart;
  372.           if (min <= max)        /* non-null range? */
  373.  
  374. --- 552,559 -----
  375.       if ((h = index(s,'-')) != Nullch) {    /* is there a -? */
  376.           min = atol(s);
  377.           max = atol(h+1);
  378. !         if (min < firstbit)        /* make sure range is in range */
  379. !         min = firstbit;
  380.           if (max > lastart)
  381.           max = lastart;
  382.           if (min <= max)        /* non-null range? */
  383. ***************
  384. *** 556,562
  385.           for (i=min; i<=max; i++)    /* for all articles in range */
  386.           ctl_set(i);        /* mark them read */
  387.       }
  388. !     else if ((i = atol(s)) >= firstart && i <= lastart) {
  389.                       /* is single number reasonable? */
  390.           ctl_set(i);            /* mark it read */
  391.           unread--;            /* decrement articles to read */
  392.  
  393. --- 561,567 -----
  394.           for (i=min; i<=max; i++)    /* for all articles in range */
  395.           ctl_set(i);        /* mark them read */
  396.       }
  397. !     else if ((i = atol(s)) >= firstbit && i <= lastart) {
  398.                       /* is single number reasonable? */
  399.           ctl_set(i);            /* mark it read */
  400.           unread--;            /* decrement articles to read */
  401.  
  402.  
  403.