From: peter@zeus.DIALix.oz.au (Peter Wemm)
Newsgroups: news.software.nn,comp.sources.bugs
Subject: nn 6.4 - Official patch #17
Date: 13 Sep 1992 11:54:00 +0800
Organization: Karam Pty. Ltd., Perth, Western Australia.
NNTP-Posting-Host: zeus.dialix.oz.au
Summary: Fixes bugs in patch #16 (I hope)
Keywords: nn patch


	     This is an official patch to nn release 6.4
	     -------------------------------------------

			      PATCH #17

			   Priority: MEDUIM

NOTE: This patch has been posted before, you may have already installed it...
If not, please be aware that future patches (official at least..) will assume
that this has been installed.

NN 6.4.16 left a few annoying bugs in the menu selection code.  Many have been
been suffering because of this, and many are missing out on the news features
introduced in Patch #15 - in particular, "consolidated-menus". For those who
are not familiar with these patches, it is a simplistic thread-like extension
to the article viewer to allow collapsing of multiple articles on the same
subject. It is not true threading, however (yet.. :-)

This patch, and the following patch #18 were posted last year as unofficial
patches which solve some of the more serious bugs.

After some discussions with interested parties, it was decided to re-post
these as as "Official", and clean up a few of the remaining rough edges
in a "Real Soon Now" patch #19.  As quite a few sites have already installed
these patches, (and also many have not...) they were re-posted to help ease
the transition.

The contents of this patch are exactly the same as the previous postings.
Do not apply it again...  You do not need to remove the old one and
re-apply.

It is reccomended that you install the PAIR of these (17,18) together.
Please also verify that the new version (PL18) is stable on your machine
before commiting to it.

cd to your source directory and type "patch < this_article".  Refuse any
reversals...

This is the "go-ahead" mail I recieved from Kim:
--------BEGIN--------
Date: Fri, 4 Sep 92 08:39:21 GMT
From: storm@olicom.dk (Kim F. Storm)
Message-Id: <9209040839.AA05197@olicom.olicom.dk>
To: Peter_Wemm@zeus.dialix.oz.au
Cc: storm@olicom.dk
Subject: Kim (that's me)

Peter,

I would appreciate if you took over the maintenance of nn 6.4.
I have something for the group menu "almost ready" - but it has
been in that state for the last year, and I have to dig into some
old archive tapes to dig out the sources.  Let me see what I can do
about it.

In the meantime, I would really appreciate if you would take
on the task of collecting whatever unofficial fixes etc. there have
been for nn 6.4.16 since its release, and put together a set of
OFFICIAL patches ( I hereby grant you the right to stamp patches as
official patches, provided you follow the current style ).

++Kim
---------END---------

>Path: zeus!DIALix!uniwa!munnari.oz.au!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!utgpu!jupiter!morgan.ucs.mun.ca!garfield!larry
>From: larry@garfield.cs.mun.ca (Larry Bouzane)
>Newsgroups: news.software.nn
>Subject: Unofficial patch to fix a few problems with NN version 6.4.16
>Message-ID: <1991Nov14.204714.6850@garfield.cs.mun.ca>
>Date: 14 Nov 91 20:47:14 GMT
>Article-I.D.: garfield.1991Nov14.204714.6850
>Organization: CS Dept., Memorial University of Newfoundland
>Lines: 172

Kim seems to have vanished.  Unfortunately there are a few problems with
NN 6.4.16 that just had to be fixed.  The patch below contains fixes for
the following problems:

- core dump due to selecting last_article+1 on screen
- core dump due to consolidating (closing) last subject in a group
  under certain circumstances.
- selecting consolidated articles with = command did not highlight
  the selected consolidated articles correctly.
- fixed unconditional CLEAR TO END OF LINE that erased the next line on
  some terminals.  (ie MINE)

No guarantees with any of these.  Have fun.  (maybe others out there
with fixes to problems that they noticed would post their fixes as
well)

Are you out there Kim?

Larry

===================================================================
RCS file: RCS/menu.c,v
retrieving revision 1.1
diff -c -r1.1 menu.c
*** /tmp/,RCSt1004819	Thu Nov 14 16:29:08 1991
--- menu.c	Thu Nov 14 16:29:16 1991
***************
*** 399,406 ****
  	else {
  	    if (collapse_subject > 0)
  		so_printf("%-.*s", collapse_subject, ah->subject);
! 	    lsubj -= 2 + collapse_subject;
! 	    so_printf("<>%s", ah->subject + ah->subj_length - lsubj);
  	}
      }
  
--- 399,405 ----
  	else {
  	    if (collapse_subject > 0)
  		so_printf("%-.*s", collapse_subject, ah->subject);
! 	    so_printf("<>%s", ah->subject + ah->subj_length - lsubj + collapse_subject + 2);
  	}
      }
  
***************
*** 408,414 ****
  	so_printf(ah->lines >= 0 ? " +%d" : " +?", ah->lines);
  
      so_end();
!     if (ah->flag & A_CLOSED) clrline_noflush();
  
   out:
      ah->disp_attr = last_attr;
--- 407,414 ----
  	so_printf(ah->lines >= 0 ? " +%d" : " +?", ah->lines);
  
      so_end();
!     if ((ah->flag & A_CLOSED) && lsubj > ah->subj_length)
!         clrline_noflush();
  
   out:
      ah->disp_attr = last_attr;
***************
*** 455,461 ****
  {
      register article_number i;
      register article_header *ah, **ahp;
!     int count = 0, o_cura;
      extern int kill_file_loaded;
  
      if (mode == 1 && re == NULL) 
--- 455,461 ----
  {
      register article_number i;
      register article_header *ah, **ahp;
!     int count = 0, o_cura, should_mark;
      extern int kill_file_loaded;
  
      if (mode == 1 && re == NULL) 
***************
*** 462,474 ****
  	if (!kill_file_loaded && !init_kill()) return 0;
  
      o_cura = cura;
!     cura = -1;
  
      for (i = 0, ahp = articles; i < n_articles; i++, ahp++) {
  	ah = *ahp;
! 	if (cura >= 0 && (ah->flag & A_ROOT_ART)) {
! 	    mark();
! 	    cura = -1;
  	}
  	if (re != NULL) {
  	    if (!regexec_cf(re, select_on_sender ? ah->sender : ah->subject)) continue;
--- 462,481 ----
  	if (!kill_file_loaded && !init_kill()) return 0;
  
      o_cura = cura;
!     should_mark = 0;
  
+     /*
+      * note: this code assumes that a visible article will be found
+      * before anything is marked
+      */
      for (i = 0, ahp = articles; i < n_articles; i++, ahp++) {
  	ah = *ahp;
! 	if (IS_VISIBLE(ah)) {
! 	    if (should_mark) {
! 		mark();
! 		should_mark = 0;
! 	    }
! 	    cura = i - firsta;
  	}
  	if (re != NULL) {
  	    if (!regexec_cf(re, select_on_sender ? ah->sender : ah->subject)) continue;
***************
*** 478,493 ****
  	count++;
  	if (ah->attr & A_SELECT) continue;
  	ah->attr = A_SELECT;
! 	if (firsta <= i && i <= (firsta+numa)) {
! 	    cura = i - firsta;
! 	    if ((ah->flag & A_CLOSED) == 0) {
! 		mark();
! 		cura = -1;
! 	    }
! 	}
      }
  
!     if (cura >= 0) mark();
  
      if (count)
  	msg("Selected %d article%s", count, plural((long)count));
--- 485,495 ----
  	count++;
  	if (ah->attr & A_SELECT) continue;
  	ah->attr = A_SELECT;
! 	if (firsta <= i && i <= (firsta+numa))
! 	    should_mark = 1;
      }
  
!     if (should_mark) mark();
  
      if (count)
  	msg("Selected %d article%s", count, plural((long)count));
***************
*** 725,731 ****
  	article_id = map & ~K_ARTICLE_ID;
  	map = K_ARTICLE_ID;
  
! 	if (article_id < 0 || article_id > menu_articles) {
  	    ding();
  	    goto loop;
  	}
--- 727,733 ----
  	article_id = map & ~K_ARTICLE_ID;
  	map = K_ARTICLE_ID;
  
! 	if (article_id < 0 || article_id >= menu_articles) {
  	    ding();
  	    goto loop;
  	}
***************
*** 1639,1644 ****
--- 1641,1647 ----
  	 }
  	 cura = article_id;
  	 next_cura = next_root_article(firsta + cura) - firsta;
+ 	 if (next_cura < 0 || next_cura > numa) next_cura = 0;
  	 if (cura >= 0) goto partial_redraw_nc;
  	 articles[cura + firsta]->menu_line = articles[firsta]->menu_line;
  	 firsta += cura;


-- 
Peter Wemm : peter@zeus.dialix.oz.au   If it's broke, fix it (The MS-DOS way)
Work phone: +61-9-479-1855    If it aint broke, don't touch it (The Unix way)
Fax: +61-9-479-1134   If we can't fix it, it ain't broke (Maintainer's Motto)
#! rnews 11939