[comp.sources.bugs] NN 6.3 -- Official Patch #4

storm@texas.dk (Kim F. Storm) (07/10/89)

This is patch #4 for nn 6.3 (part 1 of 3).

Once more the size of the patches has grown out of hands, and I have
been forced to split the patches into a three-part shell archive.
To apply the patches, you must unpack the three archives in turn
into the nn sources directory using :unshar, and then run
	patch < PATCH.4
to apply the patches.

Besides the PATCH.4 file, the following m- and s- files are also included:

			s-aux1-1.h 
	m-convex.h 
			s-fortune.h 
	m-i80286.h 	s-uport2-2.h 	
	m-sgi4D.h 	s-sgi4D.h 
	m-symmetry.h 	s-dynix3-0.h 
	m-xenix386.h	s-xenix386.h  


ABOUT PATCH #4
--------------

The rc file could be more or less zeroed out if nn was invoked while
the nnmaster was rebuilding the database after `nnadmin I' had been run.
This should no longer happen, so it will be safe to invoke nn while the
nnmaster is rebuilding the database (but it is still not recommended
practice!)

Obeying the wishes from non-nn users (and RFC 1036), the Re^n:
prefixes on response Subject: lines are not used anymore.  nn still
filters out multiple Re: prefixes, and puts just one in the Subject
line.  (Thanks to all those who voted yes to keep this nn-ism).

The article id can be included in the "In article ... ... writes:"
line by setting the `include-art-id' variable.

The variable `flow-control' can be `unset' to avoid the switching
between raw and cooked mode.  This will also avoid the flush of
type-ahead, and unfortunately also make it impossible to stop certain
actions with ^C (because tty signals are not enabled in raw mode).
Most significantly, nnadmin's V)alidate cannot be interrupted.
  It is my hope that unsetting `flow-control' will clear the problems
with nn not displaying the middle part of the screen in some cases.

The auto-kill/auto-selections made with the K command will now have an
instant effect on the current menu - killed articles will disappear
and selected articles will be high-lighted.

The 'l' leave-article command now behaves more intelligently.  It will
not mark articles as selected instantly - instead it completes the
current selection in the group, and then it will auto-select the
left-over articles and start reading mode on those.  Left-over
articles will be marked with a '+' after the article id on the menu.

The interrim 'left-over' status is also saved between invokations of nn.

The '~' command will not deselect left-over articles.  To do this,
the '~' command must be executed twice in succession.

Furthermore, if ONLY auto-selections have been performed in a group,
the selections will not be saved for the next invokation (which will
just redo the auto-selections itself).

There is a new option to nnmaster (-y) which will cause nnmaster
to perform several attempts to open a news article before regarding
it as missing (expired/cancelled).  This may happen in some flaky
network systems, i.e. when the master is accessing news via NFS or
perhaps even NNTP.

The new -f option to nnmaster will prevent nnmaster started in daemon
mode (-r) from going into background operation, i.e. -fr will not
fork/exit.

It is now possible to clear global group flags from nnadmin (Thanks to
Bernd-Gunter Nitzler).

Using `?' when prompted for a group by `nn -g' no longer messes up the screen.

The `CR' {line+1} and `d' {page+1/2} commands now work properly.

Quite a number of type conversions have been added in the hope that
nn will work on 16 bit machines (Thanks to Wietse Z. Venema and Miek
Grenier).

The Summary: line can now be included in header-lines (code Y).

There are new mail-header and news-header variables which may contain
additional customized headers to be included in the mail and news you send,
e.g.
	set mail-header Slyrf: Heck yes!;Heck: Slyrf No!
to include the lines
	Slyrf: Heck yes!
	Heck: Slyrf No!
in (all) your mail headers.

There is a new variable default-distribution which can be set to
give the default distribution for articles posted using the :post 
command.  If set it will be suggested instead of the default main group
such as `comp' when posting to comp.unix.questions.  This may be
useful to set in the global init file, e.g.
	set default-distribution local

nncheck caused big problems if a user invoked it before having run nn
at least once (to create the rc file etc.) - this is now prohibited.

The `find' command can now be used in menu mode also (bound to =).
It prompts for a regular expression, and will select all articles
ON THE MENU whose subject matches the expression.

The '*' on selected articles is now placed correctly on dumb terminals
without stand-out mode.

The dependencies in xmakefile have been updated.

The `:show kill' command now shows the original regular expressing
rather than just *regexp*.

++Kim Storm

#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
# This is part 1 of a multipart archive                                    
# do not concatenate these parts, unpack them in order with /bin/sh        
#
#	Run the following text with /bin/sh to create:
#	  PATCH.4
#	  s-aux1-1.h
#	  s-dynix3-0.h
#	  s-fortune.h
#	  s-sgi4D.h
#	  s-uport2-2.h
#	  s-xenix386.h
#	  m-convex.h
#	  m-i80286.h
#	  m-sgi4D.h
#	  m-symmetry.h
#	  m-xenix386.h
#
if test -r s2_seq_.tmp
then echo "Must unpack archives in sequence!"
     next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
     exit 1; fi
echo "x - extracting PATCH.4 (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > PATCH.4 &&
X*** /usr/storm/nn6.3.3/patchlevel.h	Fri Jun 30 11:30:40 1989
X--- patchlevel.h	Mon Jul 10 12:40:46 1989
X***************
X*** 11,17 ****
X   *	1989-06-06:  Patch 1: rc.c
X   *	1989-06-28:  Patch 2: several files
X   *	1989-06-30:  Patch 3: several files
X   */
X  
X! #define PATCHLEVEL 3
X  
X--- 11,18 ----
X   *	1989-06-06:  Patch 1: rc.c
X   *	1989-06-28:  Patch 2: several files
X   *	1989-06-30:  Patch 3: several files
X+  *	1989-07-10:  Patch 4: several files
X   */
X  
X! #define PATCHLEVEL 4
X  
X
X*** /usr/storm/nn6.3.0/admin.c	Thu Jun  1 11:10:41 1989
X--- admin.c	Wed Jul  5 14:54:49 1989
X***************
X*** 34,40 ****
X          raw();
X  	c = get_c();
X  	no_raw();
X! 	printf("%c\n\n\r", c);
X      }
X      
X      if (islower(c)) 
X--- 34,43 ----
X          raw();
X  	c = get_c();
X  	no_raw();
X! 	if (c == K_interrupt)
X! 	    s_keyboard++;
X! 	else
X! 	    printf("%c\n\n\r", c);
X      }
X      
X      if (islower(c)) 
X***************
X*** 49,55 ****
X  long min_val, max_val;
X  {
X      char buf[100];
X!     int val;
X      
X   loop:
X      
X--- 52,58 ----
X  long min_val, max_val;
X  {
X      char buf[100];
X!     long val;
X      
X   loop:
X      
X***************
X*** 56,63 ****
X      printf("%s %ld..%ld (or all): ", prompt_str, min_val, max_val);
X      fl;
X      gets(buf);
X!     if (buf[0] == 'a')
X! 	return -1;
X  
X      val =  atol(buf);
X      if (val < min_val || val > max_val) goto loop;
X--- 59,66 ----
X      printf("%s %ld..%ld (or all): ", prompt_str, min_val, max_val);
X      fl;
X      gets(buf);
X!     if (buf[0] == 'a' || buf[0] == NUL)
X! 	return -1L;
X  
X      val =  atol(buf);
X      if (val < min_val || val > max_val) goto loop;
X***************
X*** 181,187 ****
X  static master_admin()
X  {
X      register char c;
X!     int cur_group, value;
X      register group_header *gh;
X  
X      for (;;) {
X--- 184,191 ----
X  static master_admin()
X  {
X      register char c;
X!     int cur_group;
X!     long value;
X      register group_header *gh;
X  
X      for (;;) {
X***************
X*** 190,196 ****
X  "MASTER")) {
X  
X  	 case 'G':
X! 	    cur_group = get_entry("Group number",
X  				  0L, (long)(master.number_of_groups - 1));
X  	    if (cur_group >= 0)
X  		dump_m_entry(&active_groups[cur_group]);
X--- 194,200 ----
X  "MASTER")) {
X  
X  	 case 'G':
X! 	    cur_group = (int)get_entry("Group number",
X  				  0L, (long)(master.number_of_groups - 1));
X  	    if (cur_group >= 0)
X  		dump_m_entry(&active_groups[cur_group]);
X***************
X*** 219,227 ****
X  	 case 'O':
X  	    c = get_cmd("r)epeat_delay  e)xpire_level", "OPTION");
X  	    if (c != 'r' && c != 'e') break;
X! 	    value = get_entry("Option value", 1, 10000);
X  	    if (value < 0) break;
X! 	    send_master(c, (long)value, 0L);
X  	    break;
X  	    
X  	 case 'S':
X--- 223,231 ----
X  	 case 'O':
X  	    c = get_cmd("r)epeat_delay  e)xpire_level", "OPTION");
X  	    if (c != 'r' && c != 'e') break;
X! 	    value = get_entry("Option value", 1L, 10000L);
X  	    if (value < 0) break;
X! 	    send_master(c, value, 0L);
X  	    break;
X  	    
X  	 case 'S':
X***************
X*** 586,596 ****
X      article_number		first_article, next_article, this_art;
X      int				n, was_digest;
X      char			buffer[512];
X-     
X-     if (init_group(gh) <= 0)
X- 	printf("cannot access group %s\n", gh->group_name);
X  
X!     update_group(gh);
X      
X      if (validate)
X  	first_article = gh->first_l_article;
X--- 590,602 ----
X      article_number		first_article, next_article, this_art;
X      int				n, was_digest;
X      char			buffer[512];
X  
X!     if (!validate) {
X! 	if (init_group(gh) <= 0)
X! 	    printf("cannot access group %s\n", gh->group_name);
X! 
X! 	update_group(gh);
X!     }
X      
X      if (validate)
X  	first_article = gh->first_l_article;
X***************
X*** 600,606 ****
X  			      (long)gh->last_l_article);
X  
X      if (first_article < 0) first_article = gh->first_l_article;
X! 
X      ix = open_data_file(gh, 'x', OPEN_READ);
X      if (ix == NULL) {
X  	if (verbose) printf("NO INDEX FILE\n");
X--- 606,613 ----
X  			      (long)gh->last_l_article);
X  
X      if (first_article < 0) first_article = gh->first_l_article;
X!     if (first_article <= 0) first_article = 1;
X!     
X      ix = open_data_file(gh, 'x', OPEN_READ);
X      if (ix == NULL) {
X  	if (verbose) printf("NO INDEX FILE\n");
X***************
X*** 906,911 ****
X--- 913,919 ----
X  	if (init_group(gh) <= 0) continue; /* no directory */
X  
X  	if (verbose) { printf("\r%s: ", gh->group_name); clrline(); }
X+ 	update_group(gh);
X  	
X  	if (gh->group_flag & G_BLOCKED) {
X  	    if (verbose) printf("BLOCKED\n");
X
X*** /usr/storm/nn6.3.3/answer.c	Fri Jun 30 11:30:41 1989
X--- answer.c	Wed Jul  5 17:16:05 1989
X***************
X*** 5,13 ****
X  
X  extern char *temp_file;
X  
X! char *news_record	= NULL;
X! char *mail_record	= NULL;
X  
X  
X  #define INCL_MARK_SIZE	10
X  
X--- 5,18 ----
X  
X  extern char *temp_file;
X  
X! export char *default_distribution = NULL;
X! export char *extra_mail_headers	= NULL;
X! export char *extra_news_headers	= NULL;
X! export char *mail_record	= NULL;
X! export char *news_record	= NULL;
X  
X+ export int nn_re_style		= 0;	/* use Re^n: in replies */
X+ export int include_art_id	= 0;
X  
X  #define INCL_MARK_SIZE	10
X  
X***************
X*** 97,104 ****
X  	
X  	ng_line(t);
X  	ref_line(t);
X! 
X! 	end_header(t);
X  
X  	if (incl) {
X  	    fprintf(t, "In %s you write:\n", current_group->group_name);
X--- 102,109 ----
X  	
X  	ng_line(t);
X  	ref_line(t);
X!     
X! 	end_header(t, extra_mail_headers);
X  
X  	if (incl) {
X  	    fprintf(t, "In %s you write:\n", current_group->group_name);
X***************
X*** 135,145 ****
X  	}
X  
X  	ref_line(t);
X! 
X! 	end_header(t);
X  
X  	if (incl) {
X  	    if (news.ng_from) {
X  		fprintf(t, "%s writes:\n", news.ng_from);
X  		ed_line++;
X  	    } else
X--- 140,154 ----
X  	}
X  
X  	ref_line(t);
X!     
X! 	end_header(t, extra_news_headers);
X  
X  	if (incl) {
X  	    if (news.ng_from) {
X+ 		if (include_art_id && news.ng_ident)
X+ 		    fprintf(t, "In %s %s ", 
X+ 			    ah->flag & A_DIGEST ? "digest" : "article",
X+ 			    news.ng_ident);
X  		fprintf(t, "%s writes:\n", news.ng_from);
X  		ed_line++;
X  	    } else
X***************
X*** 179,185 ****
X  
X  	subj_line(t, -1, str, (char *)NULL);
X  
X! 	end_header(t);
X     
X  	if (incl) {
X  	    prompt("\1Edit\1 forwarded message? ");
X--- 188,194 ----
X  
X  	subj_line(t, -1, str, (char *)NULL);
X  
X! 	end_header(t, extra_mail_headers);
X     
X  	if (incl) {
X  	    prompt("\1Edit\1 forwarded message? ");
X***************
X*** 325,332 ****
X      if (str == NULL) return 0;
X      strcpy(keywords, str);
X      
X!     strcpy(distribution, group_name);
X!     if (str = strchr(distribution, '.')) *str = NUL;
X      
X      prompt("\1Distribution\1 (default '%s') ", distribution);
X      str = get_s(NONE, NONE, NONE, NO_COMPLETION);
X--- 334,345 ----
X      if (str == NULL) return 0;
X      strcpy(keywords, str);
X      
X!     if (default_distribution != NULL)
X! 	strcpy(distribution, default_distribution);
X!     else {
X! 	strcpy(distribution, group_name);
X! 	if (str = strchr(distribution, '.')) *str = NUL;
X!     }
X      
X      prompt("\1Distribution\1 (default '%s') ", distribution);
X      str = get_s(NONE, NONE, NONE, NO_COMPLETION);
X***************
X*** 348,354 ****
X  	fprintf(t, "Keywords: %s\n", keywords);
X  	ed_line++;
X      }
X!     fputc(NL, t);
X      fputc(NL, t);
X  
X      fclose(t);
X--- 361,368 ----
X  	fprintf(t, "Keywords: %s\n", keywords);
X  	ed_line++;
X      }
X! 
X!     end_header(t, extra_news_headers);
X      fputc(NL, t);
X  
X      fclose(t);
X***************
X*** 367,373 ****
X      
X      fputs("Subject: ", t);
X  
X!     if (re == 0) 
X  	fputs("Re: ", t);
X      else if (re > 0)
X  	fprintf(t, "Re^%d: ", re + 1);
X--- 381,387 ----
X      
X      fputs("Subject: ", t);
X  
X!     if (re == 0 || !nn_re_style) 
X  	fputs("Re: ", t);
X      else if (re > 0)
X  	fprintf(t, "Re^%d: ", re + 1);
X***************
X*** 427,435 ****
X      ed_line++;
X  }
X  
X! static end_header(t)
X  FILE *t;
X  {
X      fputc(NL, t);
X      ed_line++;
X  }
X--- 441,463 ----
X      ed_line++;
X  }
X  
X! static end_header(t, extra_headers)
X  FILE *t;
X+ register char *extra_headers;
X  {
X+     if (extra_headers != NULL && *extra_headers != NUL) {
X+ 	while (*extra_headers != NUL) {
X+ 	    if (*extra_headers == ';') {
X+ 		if (*++extra_headers == NUL) break;
X+ 		fputc(NL, t);
X+ 		ed_line++;
X+ 	    } else
X+ 		fputc(*extra_headers++, t);
X+ 	}
X+ 	fputc(NL, t);
X+ 	ed_line++;
X+     }
X+     
X      fputc(NL, t);
X      ed_line++;
X  }
X
X*** /usr/storm/nn6.3.0/articles.c	Thu Jun  1 11:10:41 1989
X--- articles.c	Sat Jul  8 17:10:23 1989
X***************
X*** 29,39 ****
X  static thunk *current_str_t = &dummy_str_t;
X  static thunk *first_art_t = &dummy_art_t;
X  static thunk *current_art_t = &dummy_art_t;
X! static int   cur_str_size = 0, cur_art_size = 0;
X  static char *next_str;
X  static article_header *next_art, **art_array;
X  
X! static unsigned max_articles = 0, mem_offset = 0;
X  
X  /*
X   * allocate one article header
X--- 29,39 ----
X  static thunk *current_str_t = &dummy_str_t;
X  static thunk *first_art_t = &dummy_art_t;
X  static thunk *current_art_t = &dummy_art_t;
X! static long  cur_str_size = 0, cur_art_size = 0;
X  static char *next_str;
X  static article_header *next_art, **art_array;
X  
X! static article_number max_articles = 0, mem_offset = 0;
X  
X  /*
X   * allocate one article header
X***************
X*** 54,60 ****
X      mem_check(ptr, (int)size, chk_msg);
X      
X      new = (thunk *)calloc(1, sizeof(thunk));
X!     mem_check(new, sizeof(thunk), "memory thunk");
X      
X      new->next_thunk = t->next_thunk;
X      t->next_thunk = new;
X--- 54,60 ----
X      mem_check(ptr, (int)size, chk_msg);
X      
X      new = (thunk *)calloc(1, sizeof(thunk));
X!     mem_check((char *)new, sizeof(thunk), "memory thunk");
X      
X      new->next_thunk = t->next_thunk;
X      t->next_thunk = new;
X***************
X*** 99,105 ****
X  	if (current_str_t->next_thunk == NULL)
X  	    new_thunk(current_str_t, 
X  		      malloc(STR_THUNK_SIZE),
X! 		      STR_THUNK_SIZE,
X  		      "string bytes");
X  
X  	current_str_t = current_str_t->next_thunk;
X--- 99,105 ----
X  	if (current_str_t->next_thunk == NULL)
X  	    new_thunk(current_str_t, 
X  		      malloc(STR_THUNK_SIZE),
X! 		      (long)STR_THUNK_SIZE,
X  		      "string bytes");
X  
X  	current_str_t = current_str_t->next_thunk;
X***************
X*** 226,232 ****
X  	}
X  	art_array = (article_header **)
X  	    calloc(max_articles, sizeof(article_header **));
X! 	mem_check(art_array, (int)max_articles, "article headers");
X  	while (--n >= 0) art_array[n] = *--articles;
X  	articles = art_array + mem_offset;
X      }
X--- 226,232 ----
X  	}
X  	art_array = (article_header **)
X  	    calloc(max_articles, sizeof(article_header **));
X! 	mem_check((char *)art_array, (int)max_articles, "article headers");
X  	while (--n >= 0) art_array[n] = *--articles;
X  	articles = art_array + mem_offset;
X      }
X***************
X*** 322,328 ****
X      
X      if (n_articles <= 1) return;
X  
X!     qsort(articles, n_articles, sizeof(article_header *), article_comp);
X  	
X      for (n = n_articles - 1, app = articles + 1; --n >= 0; app++)
X  	if (article_equal(app, app - 1)) (**app).flag |= A_SAME;
X--- 322,328 ----
X      
X      if (n_articles <= 1) return;
X  
X!     qsort((char *)articles, (int)n_articles, sizeof(article_header *), article_comp);
X  	
X      for (n = n_articles - 1, app = articles + 1; --n >= 0; app++)
X  	if (article_equal(app, app - 1)) (**app).flag |= A_SAME;
X***************
X*** 332,343 ****
X  static offset_cmp(a, b)
X  article_header **a, **b;
X  {
X!     register i;
X      
X!     if (i = (int)((*a)->a_number - (*b)->a_number))
X! 	return i;
X!     
X!     return (int)((*a)->fpos - (*b)->fpos);
X  }
X  
X  static age_cmp(ah1, ah2)
X--- 332,343 ----
X  static offset_cmp(a, b)
X  article_header **a, **b;
X  {
X!     register long i;
X      
X!     if ((i = (int)((*a)->a_number - (*b)->a_number)) == 0)
X! 	i = (*a)->fpos - (*b)->fpos;
X! 
X!     return (i > 0) ? 1 : (i < 0) ? -1 : 0;
X  }
X  
X  static age_cmp(ah1, ah2)
X***************
X*** 351,363 ****
X  
X  unsort_articles(arrival)
X  {
X!     register int i;
X      
X      for (i = n_articles; --i >= 0;)
X  	articles[i]->flag &= ~A_SAME;
X      
X      if (n_articles <= 1) return;
X!     qsort(articles, n_articles, sizeof(article_header *), 
X  	  arrival ? offset_cmp : age_cmp);
X  }
X  
X--- 351,412 ----
X  
X  unsort_articles(arrival)
X  {
X!     register article_number i;
X      
X      for (i = n_articles; --i >= 0;)
X  	articles[i]->flag &= ~A_SAME;
X      
X      if (n_articles <= 1) return;
X!     qsort((char *)articles, (int)n_articles, sizeof(article_header *), 
X  	  arrival ? offset_cmp : age_cmp);
X  }
X  
X+ /*
X+  * Eliminate articles with the A_KILL flag set preserving the present ordering.
X+  * This will only release the last entries in the articles array.
X+  * Neither strings nor articles headers are released.
X+  */
X+ 
X+ elim_articles(list, list_lgt)
X+ register article_number *list;
X+ int list_lgt;
X+ {
X+     register article_header **srca, **desta;
X+     register article_number n, count;
X+     int changed, llen;
X+     
X+     count = 0;
X+     changed = 0, llen = 0;
X+     for (n = 0, srca = desta = articles; n < n_articles; n++, srca++) {
X+ 	if ((*srca)->flag & A_KILL) {
X+ 	    if (list_lgt > 0) {
X+ 		if (n < *list) {
X+ 		    if (llen) changed = 1;
X+ 		} else
X+ 		if (n == *list) {
X+ 		    if (llen) {
X+ 			llen++;
X+ 			list_lgt--;
X+ 			*list++ = -1;
X+ 		    } else
X+ 			++(*list);
X+ 		    changed = 1;
X+ 		}
X+ 	    }
X+ 	    continue;
X+ 	}
X+ 	if (list_lgt > 0 && n == *list) {
X+ 	    *list++ = count;
X+ 	    list_lgt--;
X+ 	    llen++;
X+ 	}
X+ 	count++;
X+ 	*desta++ = *srca;
X+     }
X+     if (list_lgt > 0) {
X+ 	if (!llen) *list = 0;
X+ 	changed = 1;
X+     }
X+     n_articles = count;
X+     return changed;
X+ }
X
X*** /usr/storm/nn6.3.3/collect.c	Fri Jun 30 11:30:42 1989
X--- collect.c	Tue Jul  4 18:21:16 1989
X***************
X*** 13,22 ****
X   *	On entry, init_group has been called to setup the proper environment
X   */
X  
X! collect_group(gh)
X  register group_header *gh;
X  {
X!     int article_count, temp;
X      article_number start_collect;
X      
X      if (gh->last_l_article == 0) {
X--- 13,22 ----
X   *	On entry, init_group has been called to setup the proper environment
X   */
X  
X! long collect_group(gh)
X  register group_header *gh;
X  {
X!     long article_count, temp;
X      article_number start_collect;
X      
X      if (gh->last_l_article == 0) {
X
X*** /usr/storm/nn6.3.3/data.h	Fri Jun 30 11:30:43 1989
X--- data.h	Sat Jul  8 16:21:38 1989
X***************
X*** 36,43 ****
X  
X      int32		group_flag;
X  
X! #	define MF(n)	(1<<(n-1))
X! #	define CF(n)	(1<<(n+15))
X  
X  #	define G_MASTER_FLAGS	(MF(17)-1) /* flags that are saved on file */
X  
X--- 36,43 ----
X  
X      int32		group_flag;
X  
X! #	define MF(n)	(((int32)1)<<(n-1))
X! #	define CF(n)	(((int32)1)<<(n+15))
X  
X  #	define G_MASTER_FLAGS	(MF(17)-1) /* flags that are saved on file */
X  
X***************
X*** 122,128 ****
X      
X      int32	flag;		/* flags: 			*/
X  
X! #	define AF(n) (1<<(n-1))
X  
X  #	define A_SELECT   	AF(1)	/* article has been selected	*/
X  #	define A_SAME	    	AF(2)	/* same subject as prev. article */
X--- 122,128 ----
X      
X      int32	flag;		/* flags: 			*/
X  
X! #	define AF(n) (((int32)1)<<(n-1))
X  
X  #	define A_SELECT   	AF(1)	/* article has been selected	*/
X  #	define A_SAME	    	AF(2)	/* same subject as prev. article */
X***************
X*** 132,137 ****
X--- 132,142 ----
X  #	define A_FOLDER		AF(6)	/* article file = "folder_path"	*/
X  #	define A_CANCEL		AF(7)	/* folder entry cancelled	*/
X  #	define A_SEEN		AF(8)	/* article presented on menu	*/
X+ #	define A_KILL		AF(9)	/* eliminate article		*/
X+ #	define A_AUTO		AF(10)	/* article was auto selected	*/
X+ #	define A_READ		AF(11)	/* article has been read	*/
X+ #	define A_LEAVE		AF(12)	/* marked for later activity	*/
X+ #	define A_LEAVE_NEXT	AF(13)	/* marked for next invokation	*/
X  
X  #	define A_ST_FILED	AF(16)	/* articles is saved		*/
X  #	define A_ST_REPLY	AF(17)	/* sent reply to article	*/
X
X*** /usr/storm/nn6.3.0/db.c	Thu Jun  1 11:10:42 1989
X--- db.c	Wed Jul  5 15:36:56 1989
X***************
X*** 29,36 ****
X      
X      current_group = gh;
X  
X-     if (gh->group_flag & G_NO_DIRECTORY) return 0;
X- 
X      if (gh->group_flag & G_FOLDER) {
X  	group_position = NULL;
X  	group_file_name = NULL;
X--- 29,34 ----
X***************
X*** 47,52 ****
X--- 45,51 ----
X  	if (is_master) 
X  	    group_position = group_path_name;
X  	else {
X+ 	    if (gh->group_flag & G_NO_DIRECTORY) return 0;
X  	    strcpy(group_path_name, news_directory);
X  	    group_position = group_path_name + strlen(group_path_name);
X  	    *group_position++ = '/';
X***************
X*** 109,115 ****
X  open_master(mode)
X  {
X      FILE 			*g;
X!     int 			entries, n, cur_group;
X      char 			*strings;
X      register group_header 	*gh;
X      static int 			first_open = 1;
X--- 108,115 ----
X  open_master(mode)
X  {
X      FILE 			*g;
X!     int 			n, cur_group;
X!     unsigned			entries;
X      char 			*strings;
X      register group_header 	*gh;
X      static int 			first_open = 1;
X***************
X*** 133,141 ****
X  	
X      sorted_groups = (group_header **) 
X  	calloc(entries, sizeof(group_header *));
X!     mem_check(sorted_groups, entries, "sorted group header pointers");
X  
X!     strings = malloc((int)master.next_group_write_offset);
X      mem_check(strings, (int)master.next_group_write_offset, 
X  	      "bytes for group names");
X  
X--- 133,141 ----
X  	
X      sorted_groups = (group_header **) 
X  	calloc(entries, sizeof(group_header *));
X!     mem_check((char *)sorted_groups, entries, "sorted group header pointers");
X  
X!     strings = malloc((unsigned)master.next_group_write_offset);
X      mem_check(strings, (int)master.next_group_write_offset, 
X  	      "bytes for group names");
X  
X***************
X*** 177,183 ****
X  update_group(gh)
X  group_header *gh;
X  {
X!     int flag;
X  
X      flag = gh->group_flag & ~G_MASTER_FLAGS;
X  
X--- 177,183 ----
X  update_group(gh)
X  group_header *gh;
X  {
X!     int32 flag;
X  
X      flag = gh->group_flag & ~G_MASTER_FLAGS;
X  
X***************
X*** 200,206 ****
X  
X  sort_groups()
X  {
X!     qsort(sorted_groups, master.number_of_groups,
X  	  sizeof(group_header *), group_name_cmp);
X  }
X  
X--- 200,206 ----
X  
X  sort_groups()
X  {
X!     qsort((char *)sorted_groups, (unsigned)master.number_of_groups,
X  	  sizeof(group_header *), group_name_cmp);
X  }
X  
X***************
X*** 331,337 ****
X      if (fwrite(buf, sizeof(net_long), MASTER_FIELDS, f) != MASTER_FIELDS) return 0;
X  #else
X  
X!     if (fwrite(masterp, sizeof(master_header), 1, f) != 1) return 0;
X  #endif
X      return 1;
X  }
X--- 331,337 ----
X      if (fwrite(buf, sizeof(net_long), MASTER_FIELDS, f) != MASTER_FIELDS) return 0;
X  #else
X  
X!     if (fwrite((char *)masterp, sizeof(master_header), 1, f) != 1) return 0;
X  #endif
X      return 1;
X  }
X***************
X*** 397,403 ****
X      if (n >= 0)
X  	fseek(f, (off_t)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * n), 0);
X  
X!     if (fwrite(gh, SAVED_GROUP_HEADER_SIZE(*gh), 1, f) != 1)
X  	return 0;
X  #endif
X  
X--- 397,403 ----
X      if (n >= 0)
X  	fseek(f, (off_t)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * n), 0);
X  
X!     if (fwrite((char *)gh, SAVED_GROUP_HEADER_SIZE(*gh), 1, f) != 1)
X  	return 0;
X  #endif
X  
X***************
X*** 432,438 ****
X      if (offset) *offset += ARTICLE_FIELDS * sizeof(net_long);
X  #else
X      
X!     if (fread(dh, sizeof(data_header), 1, f) != 1) return 0;
X      if (offset) *offset += sizeof(data_header);
X  #endif
X      return 1;
X--- 432,438 ----
X      if (offset) *offset += ARTICLE_FIELDS * sizeof(net_long);
X  #else
X      
X!     if (fread((char *)dh, sizeof(data_header), 1, f) != 1) return 0;
X      if (offset) *offset += sizeof(data_header);
X  #endif
X      return 1;
X***************
X*** 462,468 ****
X  	return 0;
X  #else
X      
X!     if (fwrite(dh, sizeof(data_header), 1, f) != 1) return 0;
X  
X  #endif
X  
X--- 462,468 ----
X  	return 0;
X  #else
X      
X!     if (fwrite((char *)dh, sizeof(data_header), 1, f) != 1) return 0;
X  
X  #endif
X  
X
X*** /usr/storm/nn6.3.0/execute.c	Thu Jun  1 11:10:42 1989
X--- execute.c	Wed Jul  5 16:52:17 1989
X***************
X*** 18,24 ****
X      sig_type  (*quit)(), (*intr)(), (*cont)();
X      extern int errno;
X      
X!     was_raw = no_raw();
X      
X      while ((pid = fork()) == -1) sleep(1);
X      
X--- 18,24 ----
X      sig_type  (*quit)(), (*intr)(), (*cont)();
X      extern int errno;
X      
X!     was_raw = unset_raw();
X      
X      while ((pid = fork()) == -1) sleep(1);
X      
X***************
X*** 121,127 ****
X  {
X      int was_raw;
X      
X!     was_raw = no_raw();
X      gotoxy(0, Lines-1);
X      clrline();
X  
X--- 121,127 ----
X  {
X      int was_raw;
X      
X!     was_raw = unset_raw();
X      gotoxy(0, Lines-1);
X      clrline();
X  
X
X*** /usr/storm/nn6.3.0/expire.c	Thu Jun  1 11:10:42 1989
X--- expire.c	Tue Jul  4 18:21:15 1989
X***************
X*** 15,21 ****
X      goto error_handler; \
X  }
X  
X! expire_group(gh)
X  register group_header *gh;
X  {
X      FILE *old_x, *old_d;
X--- 15,21 ----
X      goto error_handler; \
X  }
X  
X! long expire_group(gh)
X  register group_header *gh;
X  {
X      FILE *old_x, *old_d;
X
X*** /usr/storm/nn6.3.2/folder.c	Wed Jun 28 20:07:46 1989
X--- folder.c	Tue Jul  4 18:11:08 1989
X***************
X*** 320,326 ****
X      }
X      closedir(dirp);
X      *comp = (char *)0;
X!     qsort((char *)completions, comp - completions, sizeof(char *), sort_directory);
X      comp_iterator = completions;
X      comp_help = completions;
X      
X--- 320,326 ----
X      }
X      closedir(dirp);
X      *comp = (char *)0;
X!     qsort((char *)completions, (unsigned)(comp - completions), sizeof(char *), sort_directory);
X      comp_iterator = completions;
X      comp_help = completions;
X      
X***************
X*** 527,533 ****
X      register int c;
X      register long cnt;
X      register article_header *ah, **ahp;
X!     register int n;
X      
X      if ((src = fopen(group_path_name, "r")) == NULL) {
X  	msg("Cannot open %s", group_path_name);
X--- 527,533 ----
X      register int c;
X      register long cnt;
X      register article_header *ah, **ahp;
X!     register article_number n;
X      
X      if ((src = fopen(group_path_name, "r")) == NULL) {
X  	msg("Cannot open %s", group_path_name);
X
X*** /usr/storm/nn6.3.0/global.c	Thu Jun  1 11:10:43 1989
X--- global.c	Tue Jul  4 21:02:28 1989
X***************
X*** 58,63 ****
X--- 58,70 ----
X  }
X  #endif
X  
X+ /*
X+  * who:
X+  *	0	nn
X+  *	1	nnmaster
X+  *	2	nnadmin
X+  *	3	nncheck
X+  */
X  
X  init_global(who)
X  int who;
X***************
X*** 84,90 ****
X      if (is_master) {
X  	signal(SIGINT,  catch_hangup);
X  	signal(SIGQUIT, catch_hangup);
X! 	return;
X      }
X      
X      signal(SIGINT,  catch_keyboard);
X--- 91,97 ----
X      if (is_master) {
X  	signal(SIGINT,  catch_hangup);
X  	signal(SIGQUIT, catch_hangup);
X! 	return 0;
X      }
X      
X      signal(SIGINT,  catch_keyboard);
X***************
X*** 98,109 ****
X  
X      nn_directory = mk_file_name(home_directory, ".nn");
X      
X!     if (!file_exist(nn_directory, "drwx"))
X  	mkdir(nn_directory, 0755);	/* should check here */
X! 
X      if ((env = getenv("TMPDIR")) == NULL) env = TMP_DIRECTORY;
X      temp_file = mk_file_name(env, "nn.XXXXXX");	/* dies in ANSI C! */
X      mktemp(temp_file);
X  }
X  
X  /*
X--- 105,119 ----
X  
X      nn_directory = mk_file_name(home_directory, ".nn");
X      
X!     if (who != 2 && !file_exist(nn_directory, "drwx")) {
X! 	if (who == 3) return -1;
X  	mkdir(nn_directory, 0755);	/* should check here */
X!     }
X!     
X      if ((env = getenv("TMPDIR")) == NULL) env = TMP_DIRECTORY;
X      temp_file = mk_file_name(env, "nn.XXXXXX");	/* dies in ANSI C! */
X      mktemp(temp_file);
X+     return 0;
X  }
X  
X  /*
X***************
X*** 369,381 ****
X  log_entry(va_alist)
X  va_dcl
X  {
X!     int type;
X      va_list ap;
X  
X      va_start(ap);
X      type = va_arg1(int);
X!     enter_log(type, va_args2toN);
X      va_end(ap);
X  }
X  
X  #ifdef HAVE_SYSLOG
X--- 379,392 ----
X  log_entry(va_alist)
X  va_dcl
X  {
X!     int type, rval;
X      va_list ap;
X  
X      va_start(ap);
X      type = va_arg1(int);
X!     rval = enter_log(type, va_args2toN);
X      va_end(ap);
X+     return rval;
X  }
X  
X  #ifdef HAVE_SYSLOG
X
X*** /usr/storm/nn6.3.3/group.c	Fri Jun 30 11:30:44 1989
X--- group.c	Sat Jul  8 15:05:35 1989
X***************
X*** 9,15 ****
X  #include "menu.h"
X  #include "keymap.h"
X  #include "regexp.h"
X! 
X  
X  export int  dont_split_digests = 0;
X  export int  dont_sort_articles = 0;
X--- 9,17 ----
X  #include "menu.h"
X  #include "keymap.h"
X  #include "regexp.h"
X! #ifdef HAVE_SYSLOG
X! #include <syslog.h>
X! #endif
X  
X  export int  dont_split_digests = 0;
X  export int  dont_sort_articles = 0;
X***************
X*** 150,156 ****
X  	submask++;
X  	if (subpattern != NULL) {
X  	    if (strncmp(submask, subptext, 80) != 0) {
X! 		free(subpattern);
X  		subpattern = NULL;
X  	    }
X  	}
X--- 152,158 ----
X  	submask++;
X  	if (subpattern != NULL) {
X  	    if (strncmp(submask, subptext, 80) != 0) {
X! 		free((char *)subpattern);
X  		subpattern = NULL;
X  	    }
X  	}
X***************
X*** 162,168 ****
X  	submask = NULL;
X      } else
X  	if (subpattern != NULL) {
X! 	    free(subpattern);
X  	    subpattern = NULL;
X  	}
X      
X--- 164,170 ----
X  	submask = NULL;
X      } else
X  	if (subpattern != NULL) {
X! 	    free((char *)subpattern);
X  	    subpattern = NULL;
X  	}
X      
X***************
X*** 287,293 ****
X      if ((flags & DONT_SORT_ARTICLES) == 0)
X  	sort_articles();
X      
X!     return n_articles;
X  }
X  
X  static article_number current_first_article;
X--- 289,295 ----
X      if ((flags & DONT_SORT_ARTICLES) == 0)
X  	sort_articles();
X      
X!     return n_articles > 0 ? 1 : 0;
X  }
X  
X  static article_number current_first_article;
X***************
X*** 402,408 ****
X  	if (submask == NULL && !also_read_articles) {
X  	    if (has_selection(gh, &current_first_article, &last_article)) {
X  		status = access_group(gh, current_first_article, last_article,
X! 				      DONT_SORT_ARTICLES, (char *)NULL, do_kill);
X  		do_selections(status >= 0 && n_articles);
X  		if (status < 0) goto access_exception;
X  		if (n_articles) {
X--- 404,410 ----
X  	if (submask == NULL && !also_read_articles) {
X  	    if (has_selection(gh, &current_first_article, &last_article)) {
X  		status = access_group(gh, current_first_article, last_article,
X! 				      DONT_SORT_ARTICLES, (char *)NULL, 0);
X  		do_selections(status >= 0 && n_articles);
X  		if (status < 0) goto access_exception;
X  		if (n_articles) {
X***************
X*** 433,443 ****
X   access_exception:
X  
X      if (status < 0) {
X! 	if (status == -1)
X  	    msg("DATABASE CORRUPTED FOR GROUP %s", gh->group_name);
X! /*	else
X! 	    msg("Group %s is blocked - try again later", gh->group_name);
X! */
X  	menu_return( ME_NEXT );
X      }
X      
X--- 435,451 ----
X   access_exception:
X  
X      if (status < 0) {
X! 	if (status == -1) {
X! 	    clrdisp();
X  	    msg("DATABASE CORRUPTED FOR GROUP %s", gh->group_name);
X! #ifdef HAVE_SYSLOG
X! 	    openlog("nn", LOG_CONS, LOG_DAEMON);
X! 	    syslog(LOG_ALERT, "database corrupted for newsgroup %s.",
X! 		   gh->group_name);
X! 	    closelog();
X! #endif
X! 	    user_delay(5);
X! 	}
X  	menu_return( ME_NEXT );
X      }
X      
X***************
X*** 452,462 ****
X  
X      if (menu_cmd == ME_QUIT || menu_cmd == ME_NEXT || menu_cmd == ME_PREV)
X  	if (submask == NULL && !no_update) 
X! 	    save_selection(gh, current_first_article, gh->last_l_article);
X  
X      if (menu_cmd == ME_READ || menu_cmd == ME_NO_ARTICLES) {
X  	if (did_selection) {
X! 	    int was_read = gh->group_flag & G_READ;
X  
X  	    prev_last = gh->last_l_article;
X  	    gh->last_l_article = last_article;
X--- 460,470 ----
X  
X      if (menu_cmd == ME_QUIT || menu_cmd == ME_NEXT || menu_cmd == ME_PREV)
X  	if (submask == NULL && !no_update) 
X! 	    save_selection(gh, current_first_article, gh->last_l_article, 0);
X  
X      if (menu_cmd == ME_READ || menu_cmd == ME_NO_ARTICLES) {
X  	if (did_selection) {
X! 	    int32 was_read = gh->group_flag & G_READ;
X  
X  	    prev_last = gh->last_l_article;
X  	    gh->last_l_article = last_article;
X***************
X*** 855,861 ****
X  	
X  	printf("\r%s", cur->group_name); clrline();
X  	
X! 	access_group(cur, -1, cur->last_l_article, access_mode, submask, do_kill);
X      }
X      merge_memory();
X      if (n_articles == 0) return;
X--- 863,869 ----
X  	
X  	printf("\r%s", cur->group_name); clrline();
X  	
X! 	access_group(cur, (article_number)(-1), cur->last_l_article, access_mode, submask, do_kill);
X      }
X      merge_memory();
X      if (n_articles == 0) return;
X
X*** /usr/storm/nn6.3.0/help.more	Thu Jun  1 11:10:43 1989
X--- help.more	Fri Jul  7 11:06:17 1989
X***************
X*** 7,14 ****
X  						c       compress spaces
X  ;:AGOTO ANOTHER ARTICLE;:A
X  SP      next (at end of current article)	;:ACANCEL, SUBSCRIBE, KILL;:A
X! n       next                            	C       cancel article
X! p       previous article                	U       (un)subscribe to group
X  k       kill subject (not permanently)  	K       kill/select handling
X  *       select subject                  
X        	                                  	;:AQUIT / ESCAPE;:A
X--- 7,14 ----
X  						c       compress spaces
X  ;:AGOTO ANOTHER ARTICLE;:A
X  SP      next (at end of current article)	;:ACANCEL, SUBSCRIBE, KILL;:A
X! n, p    next/previous article           	C       cancel article
X! l       mark article for later action   	U       (un)subscribe to group
X  k       kill subject (not permanently)  	K       kill/select handling
X  *       select subject                  
X        	                                  	;:AQUIT / ESCAPE;:A
X
X*** /usr/storm/nn6.3.2/init.c	Wed Jun 28 20:07:51 1989
X--- init.c	Sat Jul  8 00:04:11 1989
X***************
X*** 581,586 ****
X--- 581,587 ----
X  	    
X  	    clrdisp();
X  	    rm_kill_file();
X+ 	    free_kill_entries();
X  	    do_kill_handling = init_kill() && do_kill_handling;
X  	    return AC_REDRAW;
X  	}
X***************
X*** 646,652 ****
X  	}
X  	
X  	CASE( "coredump" ) {
X! 	    no_raw();
X  	    abort();
X  	}
X  
X--- 647,653 ----
X  	}
X  	
X  	CASE( "coredump" ) {
X! 	    unset_raw();
X  	    abort();
X  	}
X  
X
X*** /usr/storm/nn6.3.3/keymap.c	Fri Jun 30 11:30:46 1989
X--- keymap.c	Tue Jul  4 19:58:05 1989
X***************
X*** 317,323 ****
X  /* :   */		K_EXTENDED_CMD,
X  /* ;   */	K_UNBOUND, 
X  /* <   */		K_PREV_PAGE,
X! /* =   */	K_UNBOUND, 
X  /* >   */		K_NEXT_PAGE,
X  /* ?   */		K_HELP,
X  /* @   */		K_SELECT_INVERT,
X--- 317,323 ----
X  /* :   */		K_EXTENDED_CMD,
X  /* ;   */	K_UNBOUND, 
X  /* <   */		K_PREV_PAGE,
X! /* =   */		K_GOTO_MATCH, 
X  /* >   */		K_NEXT_PAGE,
X  /* ?   */		K_HELP,
X  /* @   */		K_SELECT_INVERT,
X***************
X*** 422,428 ****
X  
X      "decode",			K_UUDECODE,		0,
X  
X!     "find",			K_GOTO_MATCH,		K_ONLY_MORE,
X      "find-next",		K_NEXT_MATCH,		K_ONLY_MORE,
X      "follow",			K_FOLLOW_UP,		0,
X      "full-digest",		K_FULL_DIGEST,		K_ONLY_MORE,
X--- 422,428 ----
X  
X      "decode",			K_UUDECODE,		0,
X  
X!     "find",			K_GOTO_MATCH,		0,
X      "find-next",		K_NEXT_MATCH,		K_ONLY_MORE,
X      "follow",			K_FOLLOW_UP,		0,
X      "full-digest",		K_FULL_DIGEST,		K_ONLY_MORE,
X
X*** /usr/storm/nn6.3.3/keymap.h	Fri Jun 30 11:30:47 1989
X--- keymap.h	Thu Jul  6 15:04:13 1989
X***************
X*** 97,115 ****
X  #define	K_MACRO			0x0100 /* call macro			*/
X  #define	K_ARTICLE_ID		0x0200 /* article id in lower part	*/
X  
X- /* special keys returned by get_c() */
X- 
X- #define	K_interrupt	CTRL('G')
X- 
X- #define	K_up_arrow	0x0081
X- #define	K_down_arrow	0x0082
X- #define K_left_arrow	0x0083
X- #define K_right_arrow	0x0084
X- 
X- #define	K_function(n)	(0x0085 + n)
X- 
X- 
X- #define	GETC_COMMAND	0x4000	/* bit set by get_c to return a command */
X  
X  /*
X   * KEY MAP SIZE is:
X--- 97,102 ----
X
X*** /usr/storm/nn6.3.3/kill.c	Fri Jun 30 11:30:48 1989
X--- kill.c	Sat Jul  8 00:56:04 1989
X***************
X*** 11,22 ****
X  
X  extern char *quick_match();
X  
X! #define COMP_KILL_MAGIC	0x4b694c6c	/* KiLl */
X  
X  /*
X   * kill flags
X   */
X  
X  #define	AUTO_KILL	0x01
X  #define AUTO_SELECT	0x00	/* pseudo flag */
X  #define ON_SUBJECT	0x02
X--- 11,24 ----
X  
X  extern char *quick_match();
X  
X! #define COMP_KILL_MAGIC	0x4b694c6d	/* KiLm */
X  
X  /*
X   * kill flags
X   */
X  
X+ #define COMP_KILL_ENTRY	0x80
X+ 
X  #define	AUTO_KILL	0x01
X  #define AUTO_SELECT	0x00	/* pseudo flag */
X  #define ON_SUBJECT	0x02
X***************
X*** 52,67 ****
X  typedef struct kill_list_entry {
X      int kill_flag;
X      char *kill_pattern;
X      struct kill_list_entry *next_kill;
X  } kill_list_entry;
X  
X  
X  static kill_list_entry dummy_kill = {
X!     0, (char *)NULL, (kill_list_entry *)NULL 
X  };
X  static kill_list_entry *global_kill_list = &dummy_kill;
X  static kill_list_entry *end_kill_list = &dummy_kill;
X! 
X  
X  kill_article(ah)
X  article_header *ah;
X--- 54,72 ----
X  typedef struct kill_list_entry {
X      int kill_flag;
X      char *kill_pattern;
X+     regexp *kill_regexp;
X      struct kill_list_entry *next_kill;
X  } kill_list_entry;
X  
X+ static kill_list_entry *kill_tab;
X+ static char *kill_patterns;
X  
X  static kill_list_entry dummy_kill = {
X!     0, (char *)NULL, (regexp *)NULL, (kill_list_entry *)NULL 
X  };
X  static kill_list_entry *global_kill_list = &dummy_kill;
X  static kill_list_entry *end_kill_list = &dummy_kill;
X! static kill_list_entry latest_kl_entry;
X  
X  kill_article(ah)
X  article_header *ah;
X***************
X*** 83,89 ****
X  		continue;
X  	} else
X  	if (kl->kill_flag & KILL_ON_REGEXP) {
X! 	    if (regexec((regexp *)(kl->kill_pattern), string) == 0)
X  		continue;
X  	} else
X  	    if (quick_match(string, kl->kill_pattern) == NULL)
X--- 88,94 ----
X  		continue;
X  	} else
X  	if (kl->kill_flag & KILL_ON_REGEXP) {
X! 	    if (regexec(kl->kill_regexp, string) == 0)
X  		continue;
X  	} else
X  	    if (quick_match(string, kl->kill_pattern) == NULL)
X***************
X*** 91,98 ****
X  	
X  	if (kl->kill_flag & AUTO_KILL)
X  	    return 1;
X! 	
X! 	ah->flag |= A_SELECT;
X  	break;
X      }
X      
X--- 96,103 ----
X  	
X  	if (kl->kill_flag & AUTO_KILL)
X  	    return 1;
X! 
X! 	ah->flag |= A_SELECT | A_AUTO;
X  	break;
X      }
X      
X***************
X*** 100,119 ****
X  }
X  
X  
X! auto_select_article(ah)
X  article_header *ah;
X  {
X      register kill_list_entry *kl;
X      char *string;
X!     
X!     end_kill_list->next_kill = ah->a_group ?
X! 	(kill_list_entry *)(ah->a_group->kill_list) :
X! 	(kill_list_entry *)(current_group->kill_list);
X      
X-     kl = global_kill_list;
X      while (kl = kl->next_kill) {
X! 	if (kl->kill_flag & AUTO_KILL) continue;
X! 	
X  	if (kl->kill_flag & ON_SUBJECT)
X  	    string = ah->subject;
X  	else
X--- 105,135 ----
X  }
X  
X  
X! auto_select_article(ah, do_select)
X  article_header *ah;
X+ int do_select;
X  {
X      register kill_list_entry *kl;
X+     kill_list_entry kl_head;
X      char *string;
X! 
X!     if (do_select == 2) {
X! 	kl = &kl_head;
X! 	kl->next_kill = &latest_kl_entry;
X!     } else {
X! 	end_kill_list->next_kill = ah->a_group ?
X! 	    (kill_list_entry *)(ah->a_group->kill_list) :
X! 		(kill_list_entry *)(current_group->kill_list);
X! 	kl = global_kill_list;
X!     }
X      
X      while (kl = kl->next_kill) {
X! 	if (do_select) {
X! 	    if (kl->kill_flag & AUTO_KILL) continue;
X! 	} else {
X! 	    if ((kl->kill_flag & AUTO_KILL) == 0) continue;
X! 	}
X!      check_one:	
X  	if (kl->kill_flag & ON_SUBJECT)
X  	    string = ah->subject;
X  	else
X***************
X*** 124,130 ****
X  		continue;
X  	} else
X  	if (kl->kill_flag & KILL_ON_REGEXP) {
X! 	    if (regexec((regexp *)(kl->kill_pattern), string) == 0)
X  		continue;
X  	} else
X  	    if (quick_match(string, kl->kill_pattern) == NULL)
X--- 140,146 ----
X  		continue;
X  	} else
X  	if (kl->kill_flag & KILL_ON_REGEXP) {
X! 	    if (regexec(kl->kill_regexp, string) == 0)
X  		continue;
X  	} else
X  	    if (quick_match(string, kl->kill_pattern) == NULL)
X***************
X*** 148,164 ****
X      time_t now;
X      FILE *killf;
X      register kill_list_entry *kl;
X      char *str;
X      
X      if (flag & KILL_ON_REGEXP) {
X! 	str = (char *)regcomp(pattern);
X! 	if (str == NULL) return;
X      } else {
X! 	str = malloc(strlen(pattern) + 1);
X! 	mem_check(str, 1, "string");
X! 	
X! 	strcpy(str, pattern);
X! 	
X  	if ((flag & KILL_MUST_MATCH) == 0)
X  	    init_quick_match(str);
X      }
X--- 164,179 ----
X      time_t now;
X      FILE *killf;
X      register kill_list_entry *kl;
X+     regexp *re;
X      char *str;
X      
X+     str = copy_str(pattern);
X+ 	
X      if (flag & KILL_ON_REGEXP) {
X! 	re = regcomp(pattern);
X! 	if (re == NULL) return;
X      } else {
X! 	re = NULL;
X  	if ((flag & KILL_MUST_MATCH) == 0)
X  	    init_quick_match(str);
X      }
X***************
X*** 191,200 ****
X      rm_kill_file();
X      
X      kl = (kill_list_entry *)calloc(1, sizeof(kill_list_entry));
X!     mem_check(kl, 1, "kill list entry");
X      
X!     kl->kill_pattern = str;
X!     kl->kill_flag = flag;
X      
X      if (gh) {
X  	kl->next_kill = (kill_list_entry *)(gh->kill_list);
X--- 206,217 ----
X      rm_kill_file();
X      
X      kl = (kill_list_entry *)calloc(1, sizeof(kill_list_entry));
X!     mem_check((char *)kl, 1, "kill list entry");
X      
X!     latest_kl_entry.kill_pattern = kl->kill_pattern = str;
X!     latest_kl_entry.kill_regexp = kl->kill_regexp = re;
X!     latest_kl_entry.kill_flag = kl->kill_flag = flag;
X!     latest_kl_entry.next_kill = NULL;
X      
X      if (gh) {
X  	kl->next_kill = (kill_list_entry *)(gh->kill_list);
X***************
X*** 236,242 ****
X       case NL:
X  	if (ah == NULL) {
X  	    ah = get_menu_article();
X! 	    if (ah == NULL) return;
X  	}
X  	
X  	strcpy(buffer, ah->subject);
X--- 253,259 ----
X       case NL:
X  	if (ah == NULL) {
X  	    ah = get_menu_article();
X! 	    if (ah == NULL) return -1;
X  	}
X  	
X  	strcpy(buffer, ah->subject);
X***************
X*** 243,249 ****
X  	enter_kill_file(current_group, buffer, 
X  			AUTO_KILL | ON_SUBJECT | KILL_MUST_MATCH, 30);
X  	msg("DONE");
X! 	return;
X  	
X       case 'k':
X       case 'K':
X--- 260,266 ----
X  	enter_kill_file(current_group, buffer, 
X  			AUTO_KILL | ON_SUBJECT | KILL_MUST_MATCH, 30);
X  	msg("DONE");
X! 	return 1;
X  	
X       case 'k':
X       case 'K':
X***************
X*** 258,264 ****
X  	mode1 = "SELECT";
X  	break;
X       default:
X! 	return;
X      }
X      
X      prompt("\1AUTO %s\1 on (S)ubject or (N)ame ?", mode1);
X--- 275,281 ----
X  	mode1 = "SELECT";
X  	break;
X       default:
X! 	return -1;
X      }
X      
X      prompt("\1AUTO %s\1 on (S)ubject or (N)ame ?", mode1);
X***************
X*** 281,298 ****
X  	mode2 = "Subject";
X  	break;
X       default:
X! 	return;
X      }
X  
X      prompt("\1%s %s:\1", mode1, mode2);
X      
X      pattern = get_s(dflt, NONE, "%=/", NO_COMPLETION);
X!     if (pattern == NULL) return;
X      if (*pattern == NUL || *pattern == '%' || *pattern == '=') {
X  	if (dflt && *dflt)
X  	    pattern = dflt;
X  	else {
X! 	    if ((ah = get_menu_article()) == NULL) return;
X  	    pattern = (flag & ON_SUBJECT) ? ah->subject : ah->sender;
X  	}
X  	flag |= KILL_MUST_MATCH;
X--- 298,315 ----
X  	mode2 = "Subject";
X  	break;
X       default:
X! 	return -1;
X      }
X  
X      prompt("\1%s %s:\1", mode1, mode2);
X      
X      pattern = get_s(dflt, NONE, "%=/", NO_COMPLETION);
X!     if (pattern == NULL) return -1;
X      if (*pattern == NUL || *pattern == '%' || *pattern == '=') {
X  	if (dflt && *dflt)
X  	    pattern = dflt;
X  	else {
X! 	    if ((ah = get_menu_article()) == NULL) return -1;
X  	    pattern = (flag & ON_SUBJECT) ? ah->subject : ah->sender;
X  	}
X  	flag |= KILL_MUST_MATCH;
X***************
X*** 301,307 ****
X  	    prompt("\1%s %s\1 (regexp): ", mode1, mode2);
X      
X  	    pattern = get_s(NONE, NONE, NONE, NO_COMPLETION);
X! 	    if (pattern == NULL || *pattern == NUL) return;
X  	    flag |= KILL_ON_REGEXP;
X  	}
X      
X--- 318,324 ----
X  	    prompt("\1%s %s\1 (regexp): ", mode1, mode2);
X      
X  	    pattern = get_s(NONE, NONE, NONE, NO_COMPLETION);
X! 	    if (pattern == NULL || *pattern == NUL) return -1;
X  	    flag |= KILL_ON_REGEXP;
X  	}
X      
X***************
X*** 324,335 ****
X  	 gh = NULL;
X  	 break;
X        default:
X! 	 return;
X       }
X  
X      prompt("\1Lifetime of entry in days\1 (P)ermanent ");
X      days_str = get_s(" 30 days", NONE, "pP", NO_COMPLETION);
X!     if (days_str == NULL) return;
X  
X      if (*days_str == NUL) {
X      	days_str = "30 days";
X--- 341,352 ----
X  	 gh = NULL;
X  	 break;
X        default:
X! 	 return -1;
X       }
X  
X      prompt("\1Lifetime of entry in days\1 (P)ermanent ");
X      days_str = get_s(" 30 days", NONE, "pP", NO_COMPLETION);
X!     if (days_str == NULL) return -1;
X  
X      if (*days_str == NUL) {
X      	days_str = "30 days";
X***************
X*** 342,348 ****
X  	sprintf(days_str, "%d days", days);
X      } else {
X  	ding();
X! 	return;
X      }
X  
X      prompt("\1CONFIRM\1 %s %s %s%s: %-.35s%s ",
X--- 359,365 ----
X  	sprintf(days_str, "%d days", days);
X      } else {
X  	ding();
X! 	return -1;
X      }
X  
X      prompt("\1CONFIRM\1 %s %s %s%s: %-.35s%s ",
X***************
X*** 350,358 ****
X  	   (flag & KILL_MUST_MATCH) ? " exact" : 
X  	   (flag & KILL_ON_REGEXP) ? " regexp" : "",
X  	   pattern, strlen(pattern) > 35 ? "..." : "");
X!     if (yes(0) <= 0) return;
X      
X      enter_kill_file(gh, pattern, flag, days);
X  }
X  
X  
X--- 367,377 ----
X  	   (flag & KILL_MUST_MATCH) ? " exact" : 
X  	   (flag & KILL_ON_REGEXP) ? " regexp" : "",
X  	   pattern, strlen(pattern) > 35 ? "..." : "");
X!     if (yes(0) <= 0) return -1;
X      
X      enter_kill_file(gh, pattern, flag, days);
X+ 
X+     return (flag & AUTO_KILL) ? 1 : 0;
X  }
X  
X  
X***************
X*** 363,374 ****
X      FILE *killf;
X      comp_kill_header header;
X      comp_kill_entry  entry;
X-     kill_list_entry *kill_tab;
X      register group_header *gh;
X      register kill_list_entry *kl;
X-     char *patterns;
X      time_t kill_age, comp_age;
X!     register n;
X      
X      Loop_Groups_Header(gh)
X  	gh->kill_list = NULL;
X--- 382,393 ----
X      FILE *killf;
X      comp_kill_header header;
X      comp_kill_entry  entry;
X      register group_header *gh;
X      register kill_list_entry *kl;
X      time_t kill_age, comp_age;
X!     register long n;
X!     int first_try = 1;
X!     import char *delayed_msg;
X      
X      Loop_Groups_Header(gh)
X  	gh->kill_list = NULL;
X***************
X*** 377,405 ****
X      if (kill_age == 0) return 0;
X      
X      comp_age = file_exist(relative(nn_directory, COMPILED_KILL), "fr");
X      if (comp_age < kill_age && !compile_kill_file()) return 0;
X! 	
X      killf = open_file(relative(nn_directory, COMPILED_KILL), OPEN_READ);
X      if (killf == NULL) return 0;
X  
X!     if (fread(&header, sizeof(header), 1, killf) != 1) goto err;
X      if (header.ckh_magic != COMP_KILL_MAGIC) goto err;
X  
X!     patterns = malloc(header.ckh_pattern_size);
X!     mem_check(patterns, header.ckh_pattern_size, "kill bytes");
X      
X      kill_tab = (kill_list_entry *)
X! 	calloc(header.ckh_entries, sizeof(kill_list_entry));
X!     mem_check(kill_tab, header.ckh_entries, "kill entries");
X!     
X      for (n = header.ckh_entries, kl = kill_tab; --n >= 0; kl++) {
X! 	if (fread(&entry, sizeof(entry), 1, killf) != 1) goto err;
X  	
X! 	kl->kill_pattern = patterns + entry.ck_pattern_index;
X  	kl->kill_flag = entry.ck_flag;
X  
X! 	if (kl->kill_flag & KILL_ON_REGEXP) 
X! 	    kl->kill_pattern = (char *)regcomp(kl->kill_pattern);
X  	
X  	if (entry.ck_group >= 0) {
X  	    gh = active_groups + entry.ck_group;
X--- 396,437 ----
X      if (kill_age == 0) return 0;
X      
X      comp_age = file_exist(relative(nn_directory, COMPILED_KILL), "fr");
X+  again:
X      if (comp_age < kill_age && !compile_kill_file()) return 0;
X! 
X!     kill_tab = NULL;
X!     kill_patterns = NULL;
X!     
X      killf = open_file(relative(nn_directory, COMPILED_KILL), OPEN_READ);
X      if (killf == NULL) return 0;
X  
X!     if (fread((char *)&header, sizeof(header), 1, killf) != 1) goto err;
X      if (header.ckh_magic != COMP_KILL_MAGIC) goto err;
X  
X!     kill_patterns = malloc((unsigned)header.ckh_pattern_size);
X!     mem_check(kill_patterns, (int)header.ckh_pattern_size, "kill bytes");
X      
X      kill_tab = (kill_list_entry *)
X! 	calloc((unsigned)header.ckh_entries, sizeof(kill_list_entry));
X!     mem_check((char *)kill_tab, (int)header.ckh_entries, "kill entries");
X! 
X!     fseek(killf, (off_t)(header.ckh_entries * sizeof(entry)), 1);
X!     if (fread(kill_patterns, sizeof(char), (int)header.ckh_pattern_size, killf)
X! 	!=  header.ckh_pattern_size) goto err;
X! 
X!     fseek(killf, (off_t)sizeof(header), 0);
X      for (n = header.ckh_entries, kl = kill_tab; --n >= 0; kl++) {
X! 	if (fread((char *)&entry, sizeof(entry), 1, killf) != 1) goto err;
X! 	if (header.ckh_pattern_size <= entry.ck_pattern_index ||
X! 	    entry.ck_pattern_index < 0) goto err;
X  	
X! 	kl->kill_pattern = kill_patterns + entry.ck_pattern_index;
X  	kl->kill_flag = entry.ck_flag;
X  
X! 	if (kl->kill_flag & KILL_ON_REGEXP)
X! 	    kl->kill_regexp = regcomp(kl->kill_pattern);
X! 	else
X! 	    kl->kill_regexp = NULL;
X  	
X  	if (entry.ck_group >= 0) {
X  	    gh = active_groups + entry.ck_group;
X***************
X*** 412,428 ****
X  	}
X      }
X  	      
X-     if (fread(patterns, sizeof(char), header.ckh_pattern_size, killf)
X- 	!=  header.ckh_pattern_size) goto err;
X- 
X      fclose(killf);
X      
X      return 1;
X      
X   err:
X      fclose(killf);
X-     msg("Error in compiled kill file");
X      rm_kill_file();
X  
X      Loop_Groups_Header(gh)
X  	gh->kill_list = NULL;
X--- 444,466 ----
X  	}
X      }
X  	      
X      fclose(killf);
X      
X      return 1;
X      
X   err:
X+     if (kill_patterns != NULL) free(kill_patterns);
X+     if (kill_tab != NULL) free(kill_tab);
X+     
X      fclose(killf);
X      rm_kill_file();
X+     if (first_try) {
X+ 	first_try = 0;
X+ 	comp_age = 0;
X+ 	goto again;
X+     }
X+     
X+     delayed_msg = "Error in compiled kill file (ignored)";
X  
X      Loop_Groups_Header(gh)
X  	gh->kill_list = NULL;
X***************
X*** 509,515 ****
X  	/* flags */
X  
X  	cp = np;
X! 	flag = 0;
X  	
X  	for (;;) {
X  	    switch (*cp++) {
X--- 547,553 ----
X  	/* flags */
X  
X  	cp = np;
X! 	flag = COMP_KILL_ENTRY;
X  	
X  	for (;;) {
X  	    switch (*cp++) {
X***************
X*** 579,585 ****
X  
X      header.ckh_magic = COMP_KILL_MAGIC;
X  
X!     if (fwrite(&header, sizeof(header), 1, compf) != 1)
X  	goto err2;
X      
X      fclose(compf);
X--- 617,623 ----
X  
X      header.ckh_magic = COMP_KILL_MAGIC;
X  
X!     if (fwrite((char *)&header, sizeof(header), 1, compf) != 1)
X  	goto err2;
X      
X      fclose(compf);
X***************
X*** 629,634 ****
X--- 667,706 ----
X  }
X  
X  
X+ free_kill_entries()
X+ {
X+     register group_header *gh;
X+ 
X+     Loop_Groups_Header(gh)
X+ 	if (gh->kill_list) {
X+ 	    free_kill_list((kill_list_entry *)(gh->kill_list));
X+ 	    gh->kill_list = NULL;
X+ 	}
X+     
X+     end_kill_list->next_kill = NULL;
X+     free_kill_list(global_kill_list->next_kill);
X+ 
X+     end_kill_list = global_kill_list = &dummy_kill;
X+ 
X+     if (kill_patterns != NULL) free(kill_patterns);
X+     if (kill_tab != NULL) free(kill_tab);
X+ }
X+ 
X+ static free_kill_list(kl)
X+ register kill_list_entry *kl;
X+ {
X+     register kill_list_entry *nxt;
X+     while (kl) {
X+ 	nxt = kl->next_kill;
X+ 	if (kl->kill_regexp != NULL) free(kl->kill_regexp);
X+ 	if ((kl->kill_flag & COMP_KILL_ENTRY) == 0) {
X+ 	    if (kl->kill_pattern != NULL) free(kl->kill_pattern);
NN_IS_BETTER
echo "End of part 1"
echo "File PATCH.4 is continued in part 2"
echo "2" > s2_seq_.tmp
exit 0

-- 
Kim F. Storm        storm@texas.dk        Tel +45 429 174 00
Texas Instruments, Marielundvej 46E, DK-2730 Herlev, Denmark
	  No news is good news, but nn is better!

storm@texas.dk (Kim F. Storm) (07/10/89)

This is patch #4 for nn 6.3 (part 2 of 3).

#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file PATCH.4 continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file PATCH.4"
sed 's/^X//' << 'NN_IS_BETTER' >> PATCH.4
X+ 	    free(kl);
X+ 	}
X+ 	kl = nxt;
X+     }
X+ }
X+ 
X  dump_kill_list()
X  {
X      register kill_list_entry *kl;
X***************
X*** 646,654 ****
X  
X      if (pg_next() < 0) goto out;
X      if (pg_next() < 0) goto out;
X      so_printf("\1GROUP %s kill list entries\1", current_group->group_name);
X      
X-     kl = (kill_list_entry *)(current_group->kill_list);
X      while (kl) {
X  	if (print_kill(kl) < 0) break;
X  	kl = kl->next_kill;
X--- 718,731 ----
X  
X      if (pg_next() < 0) goto out;
X      if (pg_next() < 0) goto out;
X+ 
X+     kl = (kill_list_entry *)(current_group->kill_list);
X+     if (kl == NULL) {
X+ 	printf("No kill entries for %s", current_group->group_name);
X+ 	goto out;
X+     }
X      so_printf("\1GROUP %s kill list entries\1", current_group->group_name);
X      
X      while (kl) {
X  	if (print_kill(kl) < 0) break;
X  	kl = kl->next_kill;
X***************
X*** 669,676 ****
X      printf("\r%s ON %s '%.35s'%s\n",
X  	   kl->kill_flag & AUTO_KILL ? "KILL" : "SELECT",
X  	   kl->kill_flag & ON_SUBJECT ? "SUBJECT" : "NAME",
X! 	   kl->kill_flag & KILL_ON_REGEXP ? "*regexp*" : kl->kill_pattern,
X! 	   kl->kill_flag & KILL_MUST_MATCH ? " (exact)" : "");
X  
X      return 0;
X  }
X--- 746,754 ----
X      printf("\r%s ON %s '%.35s'%s\n",
X  	   kl->kill_flag & AUTO_KILL ? "KILL" : "SELECT",
X  	   kl->kill_flag & ON_SUBJECT ? "SUBJECT" : "NAME",
X! 	   kl->kill_pattern,
X! 	   kl->kill_flag & KILL_MUST_MATCH ? " (exact)" : 
X! 	   kl->kill_flag & KILL_ON_REGEXP ? " (re)" : "");
X  
X      return 0;
X  }
X
X*** /usr/storm/nn6.3.2/MANIFEST	Wed Jun 28 20:07:53 1989
X--- MANIFEST	Mon Jul 10 13:24:25 1989
X***************
X*** 47,61 ****
X--- 47,66 ----
X  kill.c
X  log_entry.c
X  m-att3b.h
X+ m-convex.h
X  m-dec3100.h
X  m-gould.h
X  m-hp9000.h
X+ m-i80286.h
X  m-m680x0.h
X+ m-sgi4D.h
X  m-sparc.h
X  m-sun.h
X  m-sun386i.h
X+ m-symmetry.h
X  m-template.h
X  m-vax.h
X+ m-xenix386.h
X  macro.c
X  master.c
X  match.c
X***************
X*** 95,111 ****
X--- 100,122 ----
X  regexp.h
X  reroute.c
X  routes.sample
X+ s-aux1-1.h
X  s-bsd4-2.h
X  s-bsd4-3.h
X  s-dnix5-2.h
X+ s-dynix3-0.h
X+ s-fortune.h
X  s-hpux.h
X  s-hpux2-1.h
X  s-hpux3-0.h
X+ s-sgi4D.h
X  s-sunos3.h
X  s-sunos4-0.h
X  s-template.h
X  s-tower32.h
X+ s-uport2-2.h
X  s-usg3-1.h
X+ s-xenix386.h
X  save.c
X  selection.c
X  sequence.c
X
X*** /usr/storm/nn6.3.0/macro.c	Thu Jun  1 11:10:46 1989
X--- macro.c	Wed Jul  5 16:52:14 1989
X***************
X*** 76,82 ****
X      struct macro *m1;
X      
X      m1 = (struct macro *)calloc(1, sizeof(struct macro));
X!     mem_check(m1, sizeof(struct macro), "for macro");
X  
X      if (m == NULL)
X  	m = macro[cur_m] = m1;
X--- 76,82 ----
X      struct macro *m1;
X      
X      m1 = (struct macro *)calloc(1, sizeof(struct macro));
X!     mem_check((char *)m1, sizeof(struct macro), "for macro");
X  
X      if (m == NULL)
X  	m = macro[cur_m] = m1;
X***************
X*** 123,129 ****
X      if (f == NULL) {
X  	clrdisp();
X  	printf("DEFINE MACRO %d -- END WITH 'end'\n\n\r", cur_m);
X! 	no_raw();
X  	f = stdin;
X      }
X      
X--- 123,129 ----
X      if (f == NULL) {
X  	clrdisp();
X  	printf("DEFINE MACRO %d -- END WITH 'end'\n\n\r", cur_m);
X! 	unset_raw();
X  	f = stdin;
X      }
X      
X
X*** /usr/storm/nn6.3.0/nnmaster.1m	Thu Jun  1 11:10:58 1989
X--- nnmaster.1m	Fri Jul  7 16:18:03 1989
X***************
X*** 16,21 ****
X--- 16,23 ----
X  .B nnmaster
X  [ \-\fBr [ \fP\fIN\fP ] ]
X  [ \-\fBe\fP\fIN\fP ] 
X+ [ \-\fBy\fP\fIN\fP ] 
X+ [ \-\fBf\fP ]
X  [ \-\fBC\fP ]
X  [ \-\fBE\fP ]
X  [ \-\fBu\fP ]
X***************
X*** 60,66 ****
X  .TP
X  \-\fBr\fP [ \fImin\fP ]
X  .br
X! Daemon mode.  The \fInnmaster\fP will put itself in the background,
X  and will checks for arrival of new articles and expired articles every
X  .I min
X  minutes (and update the database accordingly).  If 
X--- 62,69 ----
X  .TP
X  \-\fBr\fP [ \fImin\fP ]
X  .br
X! Daemon mode.  The \fInnmaster\fP will put itself in the background
X! (unless \-\fBf\fP is also specified),
X  and will checks for arrival of new articles and expired articles every
X  .I min
X  minutes (and update the database accordingly).  If 
X***************
X*** 80,85 ****
X--- 83,92 ----
X  I cannot recommend this unless you receive batched news; invoking
X  \fInnmaster\fP for every received article sounds too expensive to me.)
X  .TP
X+ .B \-f
X+ Run \fInnmaster\fP in foreground in daemon mode (see \-\fBr\fP).
X+ Useful if \fInnmaster\fP is invoked from inittab.
X+ .TP
X  \-\fBe\fP \fIart\fP
X  .br
X  Run internal
X***************
X*** 102,107 ****
X--- 109,122 ----
X  expired articles on tape.)  You can then use the Expire command in
X  \fInnadmin\fP(1M) to instruct the \fInnmaster\fP to expire individual
X  or all groups.
X+ .TP
X+ \-\fBy\fP \fIretries\fP
X+ .br
X+ In some networked environment, opening an article (shared from another
X+ machine via NFS) may fail for no obvious reason.  Using this option,
X+ it is possible to cause 
X+ \fInnmaster\fP to perform \fIretries\fP attempts to open an article
X+ before marking the article as non-existing in the database.
X  .TP
X  .B \-C
X  Perform a consistency check on the database on start-up, and rebuild
X
X*** /usr/storm/nn6.3.3/master.c	Fri Jun 30 11:30:51 1989
X--- master.c	Mon Jul 10 12:30:48 1989
X***************
X*** 14,19 ****
X--- 14,22 ----
X   *
X   *	-e N	expire a group if more than N articles are gone
X   *	-r N	repeat every N minutes
X+ 
X+  *	-f	foreground execution (use with -r)
X+  *	-y N	retry N times on error
X   *
X   *	-E	expire by recolleting entire groups rather than copying files
X   *	-C	check consistency of database on start-up
X***************
X*** 37,44 ****
X--- 40,51 ----
X      clean_to_expire = 0,
X      check_on_startup = 0,
X      repeat_delay = 0,
X+     foreground = 0,
X      debug_mode = 0;
X  
X+ import int
X+     retry_on_error;
X+ 
X  export int
X      trace = 0,
X  #ifdef NNTP
X***************
X*** 57,62 ****
X--- 64,72 ----
X      'e', Int_Option( expire_level ),
X      'r', Int_Option_Optional( repeat_delay, 10 ),
X  
X+     'f', Bool_Option( foreground ),
X+     'y', Int_Option( retry_on_error ),
X+ 
X      'E', Bool_Option( clean_to_expire ),
X      'C', Bool_Option( check_on_startup ),
X  
X***************
X*** 72,77 ****
X--- 82,90 ----
X  
X  static int rm_mpid_on_exit = 0;
X  
X+ extern long collect_group();
X+ extern long expire_group();
X+ 
X  main(argc, argv)
X  int argc;
X  char **argv;
X***************
X*** 81,87 ****
X      register int		cur_group;
X      int				col_article_count, col_group_count;
X      int				exp_article_count, exp_group_count;
X!     int				temp;
X      time_t			start_time;
X      FILE			*m_pid;
X  	
X--- 94,100 ----
X      register int		cur_group;
X      int				col_article_count, col_group_count;
X      int				exp_article_count, exp_group_count;
X!     long			temp;
X      time_t			start_time;
X      FILE			*m_pid;
X  	
X***************
X*** 119,127 ****
X  	close(0);
X  	close(1);
X  	close(2);
X      }
X      
X!     if (repeat_delay && !debug_mode) {
X  	while ((temp = fork()) < 0) sleep(1);
X  	if (temp) nn_exit(0);
X  
X--- 132,141 ----
X  	close(0);
X  	close(1);
X  	close(2);
X+ 	if (open("/dev/null", 2) == 0) dup(0), dup(0);
X      }
X      
X!     if (repeat_delay && !debug_mode && !foreground) {
X  	while ((temp = fork()) < 0) sleep(1);
X  	if (temp) nn_exit(0);
X  
X***************
X*** 216,226 ****
X  
X  	gh = &active_groups[cur_group];
X  
X- 	if (gh->group_flag & G_NO_DIRECTORY) {
X- 	    if (gh->group_flag & G_BLOCKED) goto unblock_group;
X- 	    continue;
X- 	}
X- 	
X  	if (gh->last_l_article  > gh->last_article || 
X  	    gh->first_l_article > gh->first_article) {
X  	    log_entry('X', "group %s renumbered", gh->group_name);
X--- 230,235 ----
X***************
X*** 250,262 ****
X  	
X       do_collect:
X  	if (!init_group(gh)) {
X! 	    log_entry('R', "%s: no directory", gh->group_name);
X! 	    gh->group_flag |= G_NO_DIRECTORY;
X  	    gh->group_flag &= ~(G_EXPIRE | G_BLOCKED);	    
X  	    save_group(current_group);
X  	    continue;
X  	}
X  	
X  	if (gh->group_flag & G_EXPIRE) {
X  	    if (clean_to_expire) {
X  		temp = gh->first_article - gh->first_l_article;
X--- 259,281 ----
X  	
X       do_collect:
X  	if (!init_group(gh)) {
X! 	    if ((gh->group_flag & G_NO_DIRECTORY) == 0) {
X! 		log_entry('R', "%s: no directory", gh->group_name);
X! 		gh->group_flag |= G_NO_DIRECTORY;
X! 	    }
X! 	    gh->last_l_article = gh->last_article;
X! 	    gh->first_l_article = gh->last_article;	/* OBS: not first */
X  	    gh->group_flag &= ~(G_EXPIRE | G_BLOCKED);	    
X  	    save_group(current_group);
X  	    continue;
X  	}
X  	
X+ 	if (gh->group_flag & G_NO_DIRECTORY) {
X+ 	    /* The directory has been created now */
X+ 	    gh->group_flag &= ~G_NO_DIRECTORY;
X+ 	    clean_group(gh);
X+ 	}
X+ 	
X  	if (gh->group_flag & G_EXPIRE) {
X  	    if (clean_to_expire) {
X  		temp = gh->first_article - gh->first_l_article;
X***************
X*** 412,418 ****
X  save_group(gh)
X  group_header *gh;
X  {
X!     int flag;
X      
X      flag = gh->group_flag;
X      gh->group_flag &= G_MASTER_FLAGS;
X--- 431,437 ----
X  save_group(gh)
X  group_header *gh;
X  {
X!     int32 flag;
X      
X      flag = gh->group_flag;
X      gh->group_flag &= G_MASTER_FLAGS;
X***************
X*** 534,540 ****
X      
X      open_master(OPEN_CREATE);
X  
X!     fseek(master_file, sizeof(master), 0);
X      
X      master.number_of_groups = 0;
X      
X--- 553,559 ----
X      
X      open_master(OPEN_CREATE);
X  
X!     fseek(master_file, (off_t)sizeof(master), 0);
X      
X      master.number_of_groups = 0;
X      
X***************
X*** 546,557 ****
X  	groupname[group.group_name_length] = NUL;
X  	group.group_name = groupname;
X  
X  	init_group(&group);
X  
X  	clean_group(&group);
X  	
X- 	group.group_flag = 0;
X- 
X  	/* moderation flag will be set by first visit_active_file call */
X  
X  	if (strcmp(groupname, "control") == 0)
X--- 565,576 ----
X  	groupname[group.group_name_length] = NUL;
X  	group.group_name = groupname;
X  
X+ 	group.group_flag = 0;
X+ 
X  	init_group(&group);
X  
X  	clean_group(&group);
X  	
X  	/* moderation flag will be set by first visit_active_file call */
X  
X  	if (strcmp(groupname, "control") == 0)
X***************
X*** 649,655 ****
X  	    visit_active_file();	/* just in case */
X  	    Loop_Groups_Header(gh) {
X  		if (gh->first_l_article + arg2 < gh->first_article) {
X! 		    gh->group_flag |= G_EXPIRE;
X  		    save_group(gh);	/* could block here */
X  		}
X  	    }
X--- 668,674 ----
X  	    visit_active_file();	/* just in case */
X  	    Loop_Groups_Header(gh) {
X  		if (gh->first_l_article + arg2 < gh->first_article) {
X! 		    gh->group_flag |= G_EXPIRE | G_BLOCKED;
X  		    save_group(gh);	/* could block here */
X  		}
X  	    }
X***************
X*** 661,667 ****
X  	    continue;
X  
X  	 case 'C':	/* clear flag */
X! 	    gh->group_flag |= arg2;
X  	    save_group(gh);
X  	    continue;
X  
X--- 680,686 ----
X  	    continue;
X  
X  	 case 'C':	/* clear flag */
X! 	    gh->group_flag &= ~arg2;
X  	    save_group(gh);
X  	    continue;
X  
X
X*** /usr/storm/nn6.3.3/menu.c	Fri Jun 30 11:30:53 1989
X--- menu.c	Sat Jul  8 19:28:08 1989
X***************
X*** 7,12 ****
X--- 7,13 ----
X  #include "term.h"
X  #include "keymap.h"
X  #include "menu.h"
X+ #include "regexp.h"
X  
X  
X  export int  preview_window = 0;	/* size of preview window */
X***************
X*** 17,22 ****
X--- 18,24 ----
X  export int  delay_redraw   = 0; /* prompt again if :-command clears screen */
X  
X  export char *delayed_msg = NULL;	/* give to msg() after redraw */
X+ export long dl_msg_arg = 0;		/* optional arg to delayed_msg */
X  
X  import also_read_articles;
X  import merged_menu;
X***************
X*** 23,31 ****
X  
X  extern group_completion();
X  
X  static int firstl;	/* first menu line */
X  
X! static int firsta;	/* first article on menu (0 based) */
X  static int cura;	/* current article */
X  static int next_cura;	/* article to become cura if >= 0 */
X  static int numa;	/* no of articles on menu - 1 */
X--- 25,35 ----
X  
X  extern group_completion();
X  
X+ static regexp *regular_expr = NULL;
X+ 
X  static int firstl;	/* first menu line */
X  
X! static article_number firsta;	/* first article on menu (0 based) */
X  static int cura;	/* current article */
X  static int next_cura;	/* article to become cura if >= 0 */
X  static int numa;	/* no of articles on menu - 1 */
X***************
X*** 45,50 ****
X--- 49,55 ----
X  #define	SAVED	4
X  #define	REMOVE	5
X  #define CANCEL	6
X+ #define	ON_LEAVE 7
X  
X  static int how;
X  
X***************
X*** 74,84 ****
X  	    how = OFF;
X  	    goto toggle;
X  	}
X  	ah->flag |= A_SELECT;
X  	break;
X  	
X       case OFF:
X! 	ah->flag &= ~A_SELECT;
X  	break;
X  
X       case INIT:
X--- 79,90 ----
X  	    how = OFF;
X  	    goto toggle;
X  	}
X+ 	ah->flag &= ~(A_LEAVE | A_READ);
X  	ah->flag |= A_SELECT;
X  	break;
X  	
X       case OFF:
X! 	ah->flag &= ~(A_SELECT | A_AUTO);
X  	break;
X  
X       case INIT:
X***************
X*** 99,111 ****
X  	return;
X  
X       case CANCEL:
X! 	gotoxy(1, lno);
X! 	if (ah->flag & A_SELECT) {
X! 	    ah->flag &= ~A_SELECT;
X  	    break;
X  	}
X  	putchar((ah->flag & A_CANCEL) ? '#' : ' ');
X  	return;
X      }
X  
X      if (cura < 0 || cura > numa) return;
X--- 105,126 ----
X  	return;
X  
X       case CANCEL:
X! 	if (must_print && (ah->flag & A_SELECT)) {
X! 	    ah->flag &= ~(A_SELECT | A_AUTO);
X  	    break;
X  	}
X+ 	ah->flag &= ~(A_SELECT | A_AUTO | A_LEAVE | A_LEAVE_NEXT | A_READ);
X+ 	gotoxy(1, lno);
X  	putchar((ah->flag & A_CANCEL) ? '#' : ' ');
X  	return;
X+ 
X+      case ON_LEAVE:
X+ 	if (cura < 0 || cura > numa) return;
X+ 	gotoxy(1, lno);
X+ 	putchar((ah->flag & A_LEAVE) ? '+' :
X+ 		(ah->flag & A_LEAVE_NEXT) ? '=' : ' ');
X+ 	return;
X+ 	
X      }
X  
X      if (cura < 0 || cura > numa) return;
X***************
X*** 124,132 ****
X  
X  	if (fmt_linenum > 4) fmt_linenum = 1;
X  	
X! 	if (ah->flag & A_CANCEL) {
X  	    gotoxy(1, lno);
X! 	    putchar('#');
X  	} else
X  	if (how == ON) {
X  	    if (so_gotoxy(1, lno, 1) == 0) putchar('*');
X--- 139,152 ----
X  
X  	if (fmt_linenum > 4) fmt_linenum = 1;
X  	
X! 	if (ah->flag & (A_CANCEL | A_LEAVE | A_LEAVE_NEXT | A_READ)) {
X  	    gotoxy(1, lno);
X! 	    putchar(
X! 		    (ah->flag & A_READ) ? '.' :
X! 		    (ah->flag & A_LEAVE) ? '+' :
X! 		    (ah->flag & A_CANCEL) ? '#' :
X! 		    '='
X! 		    );
X  	} else
X  	if (how == ON) {
X  	    if (so_gotoxy(1, lno, 1) == 0) putchar('*');
X***************
X*** 187,196 ****
X  	    so_printf(ah->lines >= 0 ? " +%d" : " +?", ah->lines);
X  
X  	so_end();
X!     } else
X  	putchar((how == OFF) ? ' ' : '*');
X!     
X!     fl;
X      
X      return;
X  }
X--- 207,216 ----
X  	    so_printf(ah->lines >= 0 ? " +%d" : " +?", ah->lines);
X  
X  	so_end();
X!     } else {
X! 	gotoxy(1, lno);
X  	putchar((how == OFF) ? ' ' : '*');
X!     }    
X      
X      return;
X  }
X***************
X*** 273,284 ****
X  {
X      register 		k_cmd, cur_k_cmd;
X      register		article_header *ah;
X!     int			last_k_cmd, last_how, was_selected;
X      int 		seen_all, menu_cmd, temp;
X!     int 		save_selected, last_save;
X      int			doing_unshar, did_unshar;
X      char 		*fname, *savemode, *init_save();
X!     int 		nexta;	/* first article on next menu */
X      int 		maxa;	/* max no of articles per menu page */
X      int 		o_firsta, o_mode;	/* for recursive calls */
X      static		menu_level = 0;
X--- 293,305 ----
X  {
X      register 		k_cmd, cur_k_cmd;
X      register		article_header *ah;
X!     int			last_k_cmd, last_how;
X      int 		seen_all, menu_cmd, temp;
X!     int 		save_selected;
X!     article_number	last_save;
X      int			doing_unshar, did_unshar;
X      char 		*fname, *savemode, *init_save();
X!     article_number	nexta;	/* first article on next menu */
X      int 		maxa;	/* max no of articles per menu page */
X      int 		o_firsta, o_mode;	/* for recursive calls */
X      static		menu_level = 0;
X***************
X*** 285,290 ****
X--- 306,312 ----
X      char		purpose[80], pr_fmt[60];
X      extern int 		enable_stop, file_completion();
X      extern int		alt_cmd_key, in_menu_mode, slow_mode, any_message;
X+     article_number	elim_list[3];
X      
X  #define	menu_return(cmd) \
X      { menu_cmd = (cmd); goto menu_exit; }
X***************
X*** 373,379 ****
X  	    REDRAW_CHECK;
X      
X  	    how = INIT;
X! 	    mark(); fl;
X  	    
X  	    if (s_keyboard) {	  /* Signal may have corrupted output.  */
X  		if (cura == 0)
X--- 395,401 ----
X  	    REDRAW_CHECK;
X      
X  	    how = INIT;
X! 	    mark(); /* fl; */
X  	    
X  	    if (s_keyboard) {	  /* Signal may have corrupted output.  */
X  		if (cura == 0)
X***************
X*** 389,395 ****
X  	    
X  	    nexta++; cura++;
X  	}
X!     
X      s_keyboard = 0;
X  
X      prompt_line = firstl + cura;
X--- 411,418 ----
X  	    
X  	    nexta++; cura++;
X  	}
X! 
X!     fl;
X      s_keyboard = 0;
X  
X      prompt_line = firstl + cura;
X***************
X*** 419,425 ****
X  	    pct(0L, (long)(n_articles-1), (long)firsta, (long)(firsta+numa)));
X  
X       if (delayed_msg != NULL) {
X! 	 msg(delayed_msg);
X  	 delayed_msg = NULL;
X       }
X  
X--- 442,448 ----
X  	    pct(0L, (long)(n_articles-1), (long)firsta, (long)(firsta+numa)));
X  
X       if (delayed_msg != NULL) {
X! 	 msg(delayed_msg, dl_msg_arg);
X  	 delayed_msg = NULL;
X       }
X  
X***************
X*** 584,590 ****
X  		 if (save(ah)) {
X  		     if (doing_unshar) {
X  			 if (save_selected)
X! 			     ah->flag &= ~A_SELECT;
X  		     } else
X  		     if (cura >= 0 && cura <= numa) {
X  			 how = save_selected ? OFF : SAVED;
X--- 607,613 ----
X  		 if (save(ah)) {
X  		     if (doing_unshar) {
X  			 if (save_selected)
X! 			     ah->flag &= ~(A_SELECT | A_AUTO);
X  		     } else
X  		     if (cura >= 0 && cura <= numa) {
X  			 how = save_selected ? OFF : SAVED;
X***************
X*** 592,598 ****
X  			 how = TOGGLE;
X  		     } else
X  		     if (save_selected)
X! 			 ah->flag &= ~A_SELECT;
X  		 }
X  	     }
X  	 }
X--- 615,621 ----
X  			 how = TOGGLE;
X  		     } else
X  		     if (save_selected)
X! 			 ah->flag &= ~(A_SELECT | A_AUTO);
X  		 }
X  	     }
X  	 }
X***************
X*** 680,686 ****
X  	 goto redraw;
X  
X        case K_KILL_HANDLING:
X! 	 kill_menu((article_header *)NULL);
X  	 goto Prompt;
X  
X        case K_CONTINUE:	/* goto next menu page or show the articles */
X--- 703,728 ----
X  	 goto redraw;
X  
X        case K_KILL_HANDLING:
X! 	 switch (kill_menu((article_header *)NULL)) {
X! 	  case 0:		/* select */
X! 	     do_auto_select((regexp *)NULL, 2);
X! 	     break;
X! 	  case 1:		/* kill */
X! 	     if (!do_auto_kill()) break;
X! 	     elim_list[0] = firsta;
X! 	     elim_list[1] = firsta + cura;
X! 	     elim_list[2] = nexta;
X! 	     if (elim_articles(elim_list, 3)) {
X! 		 firsta = elim_list[0];
X! 		 goto redraw;
X! 	     }
X! 	     firsta = elim_list[0];
X! 	     cura   = elim_list[1] - firsta;
X! 	     nexta  = elim_list[2];
X! 	     break;
X! 	  default:
X! 	     break;
X! 	 }
X  	 goto Prompt;
X  
X        case K_CONTINUE:	/* goto next menu page or show the articles */
X***************
X*** 797,803 ****
X  
X        case K_UNSELECT_ALL:
X  	 for (cura = -firsta; cura < n_articles - firsta; cura++) {
X! 	     how = OFF;
X  	     mark();
X  	 }
X  	 fl;
X--- 839,851 ----
X  
X        case K_UNSELECT_ALL:
X  	 for (cura = -firsta; cura < n_articles - firsta; cura++) {
X! 	     if (last_k_cmd == K_UNSELECT_ALL) {
X! 		 if ((articles[firsta + cura]->flag & (A_LEAVE | A_LEAVE_NEXT)) == 0)
X! 		     continue;
X! 		 articles[firsta + cura]->flag &= ~(A_LEAVE | A_LEAVE_NEXT);
X! 		 how = ON_LEAVE;
X! 	     } else
X! 		 how = OFF;
X  	     mark();
X  	 }
X  	 fl;
X***************
X*** 872,880 ****
X  	 goto Prompt;
X  
X        case K_AUTO_SELECT:
X! 	 do_auto_select();
X  	 goto same_prompt;
X  
X        case K_NEXT_PAGE:
X  	 if (nexta < n_articles) goto nextmenu;
X  	 if (firsta == 0) goto same_prompt;
X--- 920,945 ----
X  	 goto Prompt;
X  
X        case K_AUTO_SELECT:
X! 	 do_auto_select((regexp *)NULL, 1);
X  	 goto same_prompt;
X  
X+      case K_GOTO_MATCH:
X+ 	 prompt("\1Select regexp\1 ");
X+ 	 if ((fname = get_s(NONE, NONE, NONE, NO_COMPLETION)) == NULL) 
X+ 	     goto Prompt;
X+ 
X+ 	 if (*fname != NUL) {
X+ 	     if (regular_expr) free((char *)regular_expr);
X+ 	     regular_expr = regcomp(fname);
X+ 	 }
X+ 
X+ 	 if (regular_expr == NULL)
X+ 	    msg("No previous expression");
X+ 	 else
X+ 	    do_auto_select(regular_expr, 2);
X+ 
X+ 	 goto Prompt;
X+ 	
X        case K_NEXT_PAGE:
X  	 if (nexta < n_articles) goto nextmenu;
X  	 if (firsta == 0) goto same_prompt;
X***************
X*** 922,931 ****
X        preview_next:
X  	 ah = articles[firsta+article_id];
X  	 cura = article_id + 1;
X! 	 was_selected = (ah->flag & A_SELECT);
X! 
X  	 switch (more(ah, MM_PREVIEW, prompt_line)) {
X  	     
X  	  case MC_REDRAW:
X  	     next_cura = cura;
X  	     goto redraw;
X--- 987,1014 ----
X        preview_next:
X  	 ah = articles[firsta+article_id];
X  	 cura = article_id + 1;
X! 	 
X! 	 no_raw();
X  	 switch (more(ah, MM_PREVIEW, prompt_line)) {
X  	     
X+ 	  case MC_DO_KILL:
X+ 	     if (!do_auto_kill()) break;
X+ 	     elim_list[0] = firsta;
X+ 	     elim_list[1] = firsta + cura;
X+ 	     elim_articles(elim_list, 2);
X+ 	     firsta = elim_list[0];
X+ 	     next_cura = elim_list[1] - firsta;
X+ 	     goto redraw;
X+ 	     
X+ 	  case MC_DO_SELECT:
X+ 	     if (prompt_line >= 0) { /* not redrawn */
X+ 		 do_auto_select((regexp *)NULL, 2);
X+ 		 break;
X+ 	     }
X+ 	     numa = -1;
X+ 	     do_auto_select((regexp *)NULL, 2);
X+ 	     /* FALL THRU */
X+ 
X  	  case MC_REDRAW:
X  	     next_cura = cura;
X  	     goto redraw;
X***************
X*** 947,956 ****
X  		 if ((firsta + cura) >= n_articles) goto redraw;
X  		 prompt_line = Lines;
X  	     } else {
X! 		 if ((ah->flag & A_SELECT) && was_selected == 0) {
X  		     cura--;
X! 		     ah->flag &= ~A_SELECT;
X! 		     how = ON;
X  		     mark();
X  		     cura++;
X  		 }
X--- 1030,1038 ----
X  		 if ((firsta + cura) >= n_articles) goto redraw;
X  		 prompt_line = Lines;
X  	     } else {
X! 		 if (ah->flag & (A_LEAVE | A_LEAVE_NEXT)) {
X  		     cura--;
X! 		     how = ON_LEAVE;
X  		     mark();
X  		     cura++;
X  		 }
X***************
X*** 995,1001 ****
X  
X  static show_articles()
X  {
X!     register cur, next, mode;
X      int cmd, prev = -1, again;
X      
X      do {
X--- 1077,1086 ----
X  
X  static show_articles()
X  {
X!     register article_number cur, next;
X!     register article_header *ah;
X!     article_number elim_list[1];
X!     register int mode;
X      int cmd, prev = -1, again;
X      
X      do {
X***************
X*** 1011,1017 ****
X  		if (articles[next]->flag & A_SELECT) break;
X  	    }
X  	    
X! 	    articles[cur]->flag &= ~A_SELECT;
X  	    
X  	 show:
X  	    mode = 0;
X--- 1096,1102 ----
X  		if (articles[next]->flag & A_SELECT) break;
X  	    }
X  	    
X! 	    articles[cur]->flag &= ~(A_SELECT | A_AUTO);
X  	    
X  	 show:
X  	    mode = 0;
X***************
X*** 1020,1029 ****
X  	    if ((cur + 1) >= n_articles) mode |= MM_LAST_ARTICLE;
X  	    if (cur == 0) mode |= MM_FIRST_ARTICLE;
X  	    
X! 	    cmd = more(articles[cur], mode, 0);
X  	    
X  	    switch(cmd) {
X  		
X  	     case MC_PREV:
X  		if (prev == next) break;
X  		
X--- 1105,1132 ----
X  	    if ((cur + 1) >= n_articles) mode |= MM_LAST_ARTICLE;
X  	    if (cur == 0) mode |= MM_FIRST_ARTICLE;
X  	    
X! 	    cmd = more(ah = articles[cur], mode, 0);
X  	    
X  	    switch(cmd) {
X+ 	     
X+ 	     case MC_DO_KILL:
X+ 		if (do_auto_kill()) {
X+ 		    elim_list[0] = next;
X+ 		    elim_articles(elim_list, 1);
X+ 		    cur = elim_list[0];
X+ 		    if (cur <= 0) cur = n_articles;
X+ 		    continue;
X+ 		}
X+ 		break;
X  		
X+ 	     case MC_DO_SELECT:
X+ 		for (next = cur+1, cur = -1; next < n_articles; next++) {
X+ 		    if (auto_select_article(ah = articles[next], 2)) 
X+ 			ah->flag |= A_SELECT;
X+ 		    if (cur < 0 && ah->flag & A_SELECT) cur = next;
X+ 		}
X+ 		continue;
X+ 		
X  	     case MC_PREV:
X  		if (prev == next) break;
X  		
X***************
X*** 1031,1039 ****
X  		goto show;
X  		
X  	     case MC_NEXTSUBJ:
X  		for (next = cur+1; next < n_articles; next++) {
X! 		    if ((articles[next]->flag & A_SAME) == 0) break;
X! 		    articles[next]->flag &= ~A_SELECT;
X  		}
X  		for (; next < n_articles; next++) {
X  		    if (articles[next]->flag & A_SELECT) break;
X--- 1134,1143 ----
X  		goto show;
X  		
X  	     case MC_NEXTSUBJ:
X+ 		ah->flag |= A_READ;
X  		for (next = cur+1; next < n_articles; next++) {
X! 		    if (((ah = articles[next])->flag & A_SAME) == 0) break;
X! 		    ah->flag &= ~(A_SELECT | A_AUTO | A_LEAVE | A_LEAVE_NEXT);
X  		}
X  		for (; next < n_articles; next++) {
X  		    if (articles[next]->flag & A_SELECT) break;
X***************
X*** 1042,1049 ****
X  		
X  	     case MC_ALLSUBJ:
X  		for (next = cur+1; next < n_articles; next++) {
X! 		    if ((articles[next]->flag & A_SAME) == 0) break;
X! 		    articles[next]->flag |= A_SELECT;
X  		}
X  		for (next = cur+1; next < n_articles; next++)
X  		    if (articles[next]->flag & A_SELECT) break;
X--- 1146,1155 ----
X  		
X  	     case MC_ALLSUBJ:
X  		for (next = cur+1; next < n_articles; next++) {
X! 		    ah = articles[next];
X! 		    if ((ah->flag & A_SAME) == 0) break;
X! 		    ah->flag &= ~(A_AUTO | A_LEAVE | A_LEAVE_NEXT | A_READ);
X! 		    ah->flag |= A_SELECT;
X  		}
X  		for (next = cur+1; next < n_articles; next++)
X  		    if (articles[next]->flag & A_SELECT) break;
X***************
X*** 1050,1056 ****
X  		break;
X  		
X  	     case MC_MENU:
X! 		articles[cur]->flag |= A_SELECT;
X  		firsta = cur - 5;
X  		if (firsta < 0) firsta = 0;
X  		next_cura = cur - firsta;
X--- 1156,1162 ----
X  		break;
X  		
X  	     case MC_MENU:
X! 		ah->flag |= A_SELECT;
X  		firsta = cur - 5;
X  		if (firsta < 0) firsta = 0;
X  		next_cura = cur - firsta;
X***************
X*** 1058,1067 ****
X  		return SH_MENU;
X  		
X  	     case MC_QUIT:
X  		return SH_QUIT;
X  		
X  	     case MC_NEXT:
X! 		if (articles[cur]->flag & A_SELECT) again++;
X  		break;
X  
X  	     case MC_BACK_ART:
X--- 1164,1175 ----
X  		return SH_MENU;
X  		
X  	     case MC_QUIT:
X+ 		ah->flag |= A_SELECT;
X  		return SH_QUIT;
X  		
X  	     case MC_NEXT:
X! 		if ((ah->flag & (A_LEAVE | A_LEAVE_NEXT)) == 0)
X! 		    ah->flag |= A_READ;
X  		break;
X  
X  	     case MC_BACK_ART:
X***************
X*** 1076,1081 ****
X--- 1184,1190 ----
X  		break;
X  		
X  	     case MC_NEXTGROUP:
X+ 		ah->flag |= A_SELECT;
X  		return SH_NEXT;
X  		
X  	     case MC_READGROUP:
X***************
X*** 1085,1093 ****
X  	    prev = cur; cur = next;
X  	}
X  
X! 	if (again > 1)
X! 	    delayed_msg = "Showing this and the following articles again";
X! 	else
X  	    if (again == 1)
X  		delayed_msg = "Showing article again";
X  	
X--- 1194,1215 ----
X  	    prev = cur; cur = next;
X  	}
X  
X! 	for (cur = 0; cur < n_articles; cur++) 
X! 	    if (articles[cur]->flag & A_SELECT) continue;
X! 
X! 	for (cur = 0; cur < n_articles; cur++) {
X! 	    ah = articles[cur];
X! 	    if (ah->flag & A_LEAVE) {
X! 		ah->flag &= ~A_LEAVE;
X! 		ah->flag |= A_SELECT;
X! 		again++;
X! 	    }
X! 	}
X! 
X! 	if (again > 1) {
X! 	    delayed_msg = "Showing %ld articles again";
X! 	    dl_msg_arg = again;
X! 	} else
X  	    if (again == 1)
X  		delayed_msg = "Showing article again";
X  	
X***************
X*** 1155,1163 ****
X   *	if article is in range firsta..firsta+numa (incl) mark article
X   */
X  
X! static do_auto_select()
X  {
X!     register int i;
X      register article_header *ah, **ahp;
X      int count = 0, o_cura;
X      
X--- 1277,1287 ----
X   *	if article is in range firsta..firsta+numa (incl) mark article
X   */
X  
X! static do_auto_select(re, mode)
X! regexp *re;
X! int mode;
X  {
X!     register article_number i;
X      register article_header *ah, **ahp;
X      int count = 0, o_cura;
X      
X***************
X*** 1165,1185 ****
X      
X      for (i = 0, ahp = articles; i < n_articles; i++, ahp++) {
X  	ah = *ahp;
X! 	if (auto_select_article(ah)) {
X! 	    count++;
X! 	    if (ah->flag & A_SELECT) continue;
X! 	    if (firsta <= i && i <= (firsta+numa)) {
X! 		cura = i - firsta;
X! 		how = ON;
X! 		mark();
X! 	    } else
X! 		ah->flag |= A_SELECT;
X! 	}
X      }
X      
X      msg(count == 0 ? "No selections" : "Selected %d article%s",
X  	   count, count > 1 ? "s" : "");
X      cura = o_cura;
X  }
X  
X  	    
X--- 1289,1329 ----
X      
X      for (i = 0, ahp = articles; i < n_articles; i++, ahp++) {
X  	ah = *ahp;
X! 	if (re != NULL) {
X! 	    if (!regexec(re, ah->subject)) continue;
X! 	} else
X! 	    if (!auto_select_article(ah, mode)) continue;
X! 	
X! 	count++;
X! 	if (ah->flag & A_SELECT) continue;
X! 	if (firsta <= i && i <= (firsta+numa)) {
X! 	    cura = i - firsta;
X! 	    how = ON;
X! 	    mark();
X! 	} else
X! 	    ah->flag |= A_SELECT;
X      }
X      
X      msg(count == 0 ? "No selections" : "Selected %d article%s",
X  	   count, count > 1 ? "s" : "");
X      cura = o_cura;
X+ }
X+ 
X+ static do_auto_kill()
X+ {
X+     register article_number i;
X+     register article_header *ah, **ahp;
X+     int any = 0;
X+     
X+     for (i = 0, ahp = articles; i < n_articles; i++, ahp++) {
X+ 	ah = *ahp;
X+ 	if (auto_select_article(ah, 0)) {
X+ 	    ah->flag |= A_KILL;
X+ 	    ah->flag &= ~(A_SELECT | A_AUTO);
X+ 	    any = 1;
X+ 	}
X+     }
X+     return any;
X  }
X  
X  	    
X
X*** /usr/storm/nn6.3.3/menu.h	Fri Jun 30 11:30:55 1989
X--- menu.h	Thu Jul  6 00:06:59 1989
X***************
X*** 33,38 ****
X--- 33,40 ----
X  #define MC_NO_REDRAW	11	/* screen is not corrupted */
X  #define	MC_BACK_ART	12	/* back one article (don't deselect cur) */
X  #define MC_FORW_ART	13	/* forward one article (deselect cur) */
X+ #define MC_DO_KILL	14	/* did kill-select kill */
X+ #define MC_DO_SELECT	15	/* did kill-select selection */
X  
X  /* more modes */
X  
X
X*** /usr/storm/nn6.3.3/more.c	Fri Jun 30 11:30:56 1989
X--- more.c	Sat Jul  8 19:24:54 1989
X***************
X*** 16,21 ****
X--- 16,22 ----
X  import int  novice;
X  
X  import char *delayed_msg;
X+ import long dl_msg_arg;
X  
X  extern char *init_save();
X  
X***************
X*** 47,52 ****
X--- 48,54 ----
X      'S', "Subject",	&news.ng_subj,		&digest.dg_subj,
X      'W', "Followup-To",	&news.ng_follow,	0,
X      'X', "References",	&news.ng_ref,		0,
X+     'Y', "Summary",	&news.ng_summ,		0,
X      0
X  };
X  
X***************
X*** 54,60 ****
X  int32 flag;
X  {
X      static char buf[40];
X!     register char *cp, *sp;
X      static int32 prevflag = 0;
X      
X      flag &= A_ST_FILED | A_ST_REPLY | A_ST_FOLLOW;
X--- 56,62 ----
X  int32 flag;
X  {
X      static char buf[40];
X!     register char *cp;
X      static int32 prevflag = 0;
X      
X      flag &= A_ST_FILED | A_ST_REPLY | A_ST_FOLLOW;
X***************
X*** 108,114 ****
X      int underline_line, fake_underline;
X      int match_lines, match_redraw, match_topline, match_botline;
X      int goto_line, prev_goto, stop_line, extra_lines;
X!     int in_digest = ah->flag & A_DIGEST;
X      article_header digestah;
X      char *fname, *hdrline;
X      extern STANDOUT;
X--- 110,116 ----
X      int underline_line, fake_underline;
X      int match_lines, match_redraw, match_topline, match_botline;
X      int goto_line, prev_goto, stop_line, extra_lines;
X!     int32 in_digest = ah->flag & A_DIGEST;
X      article_header digestah;
X      char *fname, *hdrline;
X      extern STANDOUT;
X***************
X*** 622,628 ****
X  	   a_st_flags(ah->flag));
X  
X      if (delayed_msg != NULL) {
X! 	msg(delayed_msg);
X  	delayed_msg = NULL;
X      }
X      
X--- 624,630 ----
X  	   a_st_flags(ah->flag));
X  
X      if (delayed_msg != NULL) {
X! 	msg(delayed_msg, dl_msg_arg);
X  	delayed_msg = NULL;
X      }
X      
X***************
X*** 657,663 ****
X  	}
X  #endif	
X  	 goto redraw;
X! 	
X       case K_CONTINUE:
X  	if (eof) break;
X  	if (screen_offset == 0 && form_feed == 0 && stop_line) {
X--- 659,672 ----
X  	}
X  #endif	
X  	 goto redraw;
X! 
X!      case K_NEXT_PAGE:
X! 	if (eof) {
X! 	    ding();
X! 	    goto same_prompt;
X! 	}
X! 	/* FALL THRU */
X! 	    
X       case K_CONTINUE:
X  	if (eof) break;
X  	if (screen_offset == 0 && form_feed == 0 && stop_line) {
X***************
X*** 755,761 ****
X  	goto redraw;
X  	
X       case K_KILL_HANDLING:
X! 	kill_menu(ah);
X  	goto Prompt;
X  	
X       case K_READ_GROUP_UPDATE:
X--- 764,777 ----
X  	goto redraw;
X  	
X       case K_KILL_HANDLING:
X! 	switch (kill_menu(ah)) {
X! 	 case 0:
X! 	    more_return(MC_DO_SELECT);
X! 	 case 1:
X! 	    more_return(MC_DO_KILL);
X! 	 default:
X! 	    break;
X! 	}
X  	goto Prompt;
X  	
X       case K_READ_GROUP_UPDATE:
X***************
X*** 812,822 ****
X  	clrpage(prompt_line);
X  	no_raw();
X  	
X! 	if (print_lines + lno < Lines)
X  	    goto next_page;
X  	    
X  	gotoxy(0, Lines-1);
X! 	c = print_lines + lno - Lines + 1;
X  	while (--c >= 0) {
X  	    putchar(NL);
X  	    if (--lno1 < 0) topline++;
X--- 828,838 ----
X  	clrpage(prompt_line);
X  	no_raw();
X  	
X! 	if (print_lines + lno < (Lines - 1))
X  	    goto next_page;
X  	    
X  	gotoxy(0, Lines-1);
X! 	c = print_lines + lno - Lines + 2;
X  	while (--c >= 0) {
X  	    putchar(NL);
X  	    if (--lno1 < 0) topline++;
X***************
X*** 893,899 ****
X  	    goto Prompt;
X  
X  	if (*fname && *fname != '/') {
X! 	    if (regular_expr) free(regular_expr);
X  	    regular_expr = regcomp(fname);
X  	}
X  
X--- 909,915 ----
X  	    goto Prompt;
X  
X  	if (*fname && *fname != '/') {
X! 	    if (regular_expr) free((char *)regular_expr);
X  	    regular_expr = regcomp(fname);
X  	}
X  
X***************
X*** 941,947 ****
X  	}
X  
X       case K_LEAVE_ARTICLE:
X! 	ah->flag |= A_SELECT;
X  	/* fall thru */
X  
X       case K_NEXT_ARTICLE:
X--- 957,964 ----
X  	}
X  
X       case K_LEAVE_ARTICLE:
X! 	ah->flag &= ~(A_SELECT | A_AUTO | A_READ);
X! 	ah->flag |= A_LEAVE;
X  	/* fall thru */
X  
X       case K_NEXT_ARTICLE:
X***************
X*** 1008,1014 ****
X      if ((mode & MM_PREVIEW) && more_cmd != MC_QUIT) {
X  	gotoxy(0, screen_offset);
X  	clrpage(screen_offset);
X! 	if (more_cmd == MC_PREVIEW_NEXT) {
X  	    if (screen_offset == 0) prompt_line = -1;
X  	} else {
X  	    if (screen_offset == 0) return MC_REDRAW;
X--- 1025,1032 ----
X      if ((mode & MM_PREVIEW) && more_cmd != MC_QUIT) {
X  	gotoxy(0, screen_offset);
X  	clrpage(screen_offset);
X! 	if (more_cmd == MC_PREVIEW_NEXT ||
X! 	    more_cmd == MC_DO_SELECT || more_cmd == MC_DO_KILL) {
X  	    if (screen_offset == 0) prompt_line = -1;
X  	} else {
X  	    if (screen_offset == 0) return MC_REDRAW;
X
X*** /usr/storm/nn6.3.0/news.c	Thu Jun  1 11:10:47 1989
X--- news.c	Mon Jul  3 17:59:12 1989
X***************
X*** 66,71 ****
X--- 66,72 ----
X  	    news.ng_dist 	= NULL;
X  	    news.ng_org 	= NULL;
X  	    news.ng_appr 	= NULL;
X+ 	    news.ng_summ	= NULL;
X  	    news.ng_date	= NULL;
X  	}
X  
X***************
X*** 225,230 ****
X--- 226,233 ----
X  	check("ubject: ",	 8, ng_subj);
X  	if (news.ng_from == NULL)
X  	    check("ender: ",	 7, ng_from);
X+ 	if (!all) break;
X+ 	check("ummary: ",	 8, ng_summ);
X  	break;
X  
X       case 'T':
X
X*** /usr/storm/nn6.3.0/news.h	Thu Jun  1 11:10:47 1989
X--- news.h	Mon Jul  3 17:59:12 1989
X***************
X*** 22,28 ****
X  	char	*ng_dist;	/*   distibution		*/
X  	char	*ng_org;	/*   organization		*/
X  	char	*ng_appr;	/*   approved			*/
X! 
X  	char	*ng_date;	/*   date			*/
X  	
X  	char	*ng_xlines;	/*   lines (from header)	*/
X--- 22,29 ----
X  	char	*ng_dist;	/*   distibution		*/
X  	char	*ng_org;	/*   organization		*/
X  	char	*ng_appr;	/*   approved			*/
X! 	char	*ng_summ;	/*   summary			*/
X! 	
X  	char	*ng_date;	/*   date			*/
X  	
X  	char	*ng_xlines;	/*   lines (from header)	*/
X
X*** /usr/storm/nn6.3.3/nn.1	Fri Jun 30 11:30:58 1989
X--- nn.1	Sat Jul  8 01:26:21 1989
X***************
X*** 106,116 ****
X  .I never
X  mark unread articles as read.
X  .TP
X  \fInews.group\fP  or  \fIfile\fP  or  \fI+folder\fP 
X  If none of these arguments are given, all subscribed news groups will
X  be used.  Otherwise, only the specified news groups and/or files will
X  be collected and presented.  In specifying a news groups, the
X! following `meta notation' can be used: If the news group ends with a
X  \&`.' (or `.all'), all subgroups of the news group will be collected,
X  e.g.
X  .br
X--- 106,125 ----
X  .I never
X  mark unread articles as read.
X  .TP
X+ \-\fBX\fP	{\fIno corresponding variable\fP}
X+ Read/scan unsubscribed groups also.  Most useful when looking for
X+ a specific subject in \fBall\fP groups, e.g.
X+ .br
X+    nn -mxX -sSubject all
X+ .br
X+ .TP
X  \fInews.group\fP  or  \fIfile\fP  or  \fI+folder\fP 
X  If none of these arguments are given, all subscribed news groups will
X  be used.  Otherwise, only the specified news groups and/or files will
X  be collected and presented.  In specifying a news groups, the
X! following `meta notation' can be used:
X! .br
X! If the news group ends with a
X  \&`.' (or `.all'), all subgroups of the news group will be collected,
X  e.g.
X  .br
X***************
X*** 121,127 ****
X  .br
X  	\&.sources.unix
X  .br
X! These notations cannot be mixed (yet)!
X  .SH COMMAND INPUT
X  In general, \fInn\fP commands consist of one or two key-strokes, and \fInn\fP
X  reacts instantly to the commands you give it; you don't have to enter 
X--- 130,136 ----
X  .br
X  	\&.sources.unix
X  .br
X! The argument `all' identifies all (subscribed) news groups.
X  .SH COMMAND INPUT
X  In general, \fInn\fP commands consist of one or two key-strokes, and \fInn\fP
X  reacts instantly to the commands you give it; you don't have to enter 
X***************
X*** 366,371 ****
X--- 375,385 ----
X  \&\fB+\fP	{\fBselect-auto\fP}
X  Perform auto-selections in the group (see the section on "auto
X  kill/select" below).
X+ .TP
X+ \&\fB=\fP	{\fBfind\fP}
X+ Prompts for a regular expression, and selects all articles on the menu
X+ (all pages) whose subject matches the regular expression.  An empty
X+ answer (\fB= return\fP) will reuse the previous expression.
X  .LP
X  During selection, the cursor will normally be placed on the article
X  following the last selected article (initially the first article).
X***************
X*** 563,569 ****
X  in the group have been read as usual, these `left over' articles will
X  be presented once more.  This is useful if you see an article which
X  you may want to respond to unless one the following articles is
X! already saying what you intended to say.
X  .TP
X  \&\fBp\fP	{\fBprevious\fP}
X  Goto previous article.
X--- 577,584 ----
X  in the group have been read as usual, these `left over' articles will
X  be presented once more.  This is useful if you see an article which
X  you may want to respond to unless one the following articles is
X! already saying what you intended to say.  The `left over' article is
X! marked with a `+' following the article id on the menu.
X  .TP
X  \&\fBp\fP	{\fBprevious\fP}
X  Goto previous article.
X***************
X*** 649,656 ****
X  Skip the rest of the current article, and \fIpreview the next article\fP.
X  .TP
X  \&\fBl\fP	{\fBleave-article\fP}
X! Select the article on the menu, then skip the rest of the current
X! article, and preview the next article.
X  .TP
X  \&\fB%\fP\fIy\fP	{\fBpreview\fP}
X  Preview article 
X--- 664,673 ----
X  Skip the rest of the current article, and \fIpreview the next article\fP.
X  .TP
X  \&\fBl\fP	{\fBleave-article\fP}
X! Mark the article as `left over' on the menu for handling later on.
X! Then skip the rest of the current 
X! article, and preview the next article.  The `left over' article is
X! marked with a `+' following the article id on the menu.
X  .TP
X  \&\fB%\fP\fIy\fP	{\fBpreview\fP}
X  Preview article 
X***************
X*** 1732,1737 ****
X--- 1749,1760 ----
X  \fBdebug\fP \fImask\fP	(integer, default 0)
X  Look in the source if you are going to use this.
X  .TP
X+ \fBdefault-distribution\fP \fIdistr\fP	(string, default not set)
X+ The distribution to use as the default suggestion when posting
X+ articles using the \fBpost\fP command.  If it is not set, the
X+ first component of the group name is used as the suggested
X+ distribution, e.g. `comp' when posting to comp.whatever.
X+ .TP
X  \fBdefault-save-file\fP \fIfile\fP	(string, default +$F)
X  The default save file used in quick save mode.  It can also be
X  specified using the abbreviation "+" as the file name in normal save
X***************
X*** 1832,1837 ****
X--- 1855,1869 ----
X  When set, \fInn\fP will save articles in a format that is compatible
X  with normal mail folders.
X  .TP
X+ \fBmail-header\fP \fIheaders\fP	(string, default not set)
X+ The \fIheaders\fP string specifies one or more extra header lines
X+ (separated by semi-colons `;') which are added to the header of mail
X+ sent from \fInn\fP using the \fBreply\fP and \fBmail\fP commands.  For
X+ example: 
X+ .br
X+    set mail-header Reply-To: storm@texas.dk
X+ .br
X+ .TP
X  \fBmail-record\fP \fIfile\fP	(string, default not set)
X  \fIfile\fP must be a full path name of a file.  If defined, all replies and
X  mail will be saved in this file in standard
X***************
X*** 1850,1855 ****
X--- 1882,1893 ----
X  characters in the received messages using a "cat -v" like format.
X  Otherwise, only the printable characters are shown (default).
X  .TP
X+ \fBnews-header\fP \fIheaders\fP	(string, default not set)
X+ The \fIheaders\fP string specifies one or more extra header lines
X+ (separated by semi-colons `;') which are added to the header of
X+ articles posted from \fInn\fP using the \fBfollow\fP and \fBpost\fP
X+ commands.
X+ .TP
X  \fBnews-record\fP \fIfile\fP	(string, default not set)
X  Save file for follow-ups and postings.  Same rules and format as the
X  \fBmail-record\fP variable.
X***************
X*** 2029,2034 ****
X--- 2067,2074 ----
X  \fBW\fP	Followup-To:
X  .br
X  \fBX\fP	References:
X+ .br
X+ \fBY\fP	Summary:
X  .in -8n
X  .DT
X  .LP
X***************
X*** 2153,2158 ****
X--- 2193,2205 ----
X  read articles.  This will 
X  .I never
X  mark unread articles as read.
X+ .TP
X+ \-\fBX\fP	{\fIno corresponding variable\fP}
X+ Read/scan unsubscribed groups also.  Most useful when looking for
X+ a specific subject in all groups, e.g.
X+ .br
X+    nn -mxX -sSubject all
X+ .br
X  .SH KEY MAPPINGS
X  The descriptions of the keys and commands provided in this manual
X  reflects the default key mappings in \fInn\fP.  However, you can
X***************
X*** 2304,2310 ****
X  .br
X  \fBcontinue\fP	\fBspace\fP 	\fBspace\fP 
X  .br
X! \fBfind\fP	\fBnix\fP 	/ 
X  .br
X  \fBfind-next\fP	\fBnix\fP 	. 
X  .br
X--- 2351,2357 ----
X  .br
X  \fBcontinue\fP	\fBspace\fP 	\fBspace\fP 
X  .br
X! \fBfind\fP	= 	/ 
X  .br
X  \fBfind-next\fP	\fBnix\fP 	. 
X  .br
X
X*** /usr/storm/nn6.3.0/nn.c	Thu Jun  1 11:10:57 1989
X--- nn.c	Sat Jul  8 01:26:22 1989
X***************
X*** 30,35 ****
X--- 30,36 ----
X      show_article_date, first_page_lines,			/* more.c */
X      dont_split_digests, dont_sort_articles,			/* group.c */
X      dont_sort_folders,						/* folder.c */
X+     also_unsub_groups,						/* sequence.c*/
X      show_current_time, conf_dont_sleep;				/* term.c */
X  
X  Option_Description(nn_options) {
X***************
X*** 52,57 ****
X--- 53,59 ----
X      'w', Int_Option_Optional(preview_window, 5),
X      'W', Bool_Option(conf_dont_sleep),
X      'x', Int_Option_Optional(also_read_articles, -1),
X+     'X', Bool_Option(also_unsub_groups),
X      'Z', Int_Option(Debug),
X      '\0',
X  };
X***************
X*** 84,98 ****
X      extern long unread_articles;
X      extern char *program_name();
X      int emacs_slave_mode = 0, check_news = 0, enter_admin_mode = 0;
X! 
X      pname = program_name(argv);
X!     if (strcmp(pname, "nnadmin") == 0)
X  	enter_admin_mode = 1;
X!     else
X      if (strcmp(pname, "nnemacs") == 0)
X  	emacs_slave_mode = 1;
X      else
X      if (strcmp(pname, "nncheck") == 0) {
X  	keep_rc_backup = 0;    
X  	check_news = 1;
X      }
X--- 86,103 ----
X      extern long unread_articles;
X      extern char *program_name();
X      int emacs_slave_mode = 0, check_news = 0, enter_admin_mode = 0;
X!     int who_am_i = 0;
X!     
X      pname = program_name(argv);
X!     if (strcmp(pname, "nnadmin") == 0) {
X! 	who_am_i = 2;
X  	enter_admin_mode = 1;
X!     } else
X      if (strcmp(pname, "nnemacs") == 0)
X  	emacs_slave_mode = 1;
X      else
X      if (strcmp(pname, "nncheck") == 0) {
X+ 	who_am_i = 3;
X  	keep_rc_backup = 0;    
X  	check_news = 1;
X      }
X***************
X*** 103,109 ****
X  	    nn_exit(1);
X  	}
X      
X!     init_global(0);
X      init_key_map();
X      init_execute();
X      init_macro();
X--- 108,118 ----
X  	    nn_exit(1);
X  	}
X      
X!     if (init_global(who_am_i) < 0) {
X! 	fprintf(stderr, "%s: nn has not been invoked to initialize user files\n", pname);
X! 	nn_exit(1);
X!     }
X!     
X      init_key_map();
X      init_execute();
X      init_macro();
X***************
X*** 209,217 ****
X      }
X  
X      if (prompt_for_group) {
X  	raw();
X  	current_group = NULL;
X! 	prompt_line = Lines - 1;
X  	goto_group(K_GOTO_GROUP, (article_header *)NULL);
X  	no_raw();
X  	clrdisp();
X--- 218,227 ----
X      }
X  
X      if (prompt_for_group) {
X+ 	printf("\r\n\n"); 
X  	raw();
X  	current_group = NULL;
X! 	prompt_line = Lines - 3;
X  	goto_group(K_GOTO_GROUP, (article_header *)NULL);
X  	no_raw();
X  	clrdisp();
X***************
X*** 276,281 ****
X--- 286,293 ----
X      
X      if (loop) exit(n);
X      loop++;
X+ 
X+     unset_raw();
X      
X  #ifdef NNTP
X      nntp_cleanup();
X***************
X*** 352,358 ****
X  		cur->last_l_article = 0;
X  	    }
X  	} else
X! 	    menu_cmd = group_menu(cur, -1, 
X  				  match_subject, do_kill_handling, menu);
X  
X  	if (menu_cmd != ME_NO_ARTICLES)
X--- 364,370 ----
X  		cur->last_l_article = 0;
X  	    }
X  	} else
X! 	    menu_cmd = group_menu(cur, (article_number)(-1), 
X  				  match_subject, do_kill_handling, menu);
X  
X  	if (menu_cmd != ME_NO_ARTICLES)
X
X*** /usr/storm/nn6.3.2/rc.c	Wed Jun 28 20:08:07 1989
X--- rc.c	Wed Jul  5 14:53:09 1989
X***************
X*** 186,191 ****
X--- 186,197 ----
X  	    gh->group_flag |= G_SUBSCRIPTION | G_NEW;
X  
X  	gh->last_article = LASTART(line);
X+ 
X+ 	if (gh->group_flag & G_BLOCKED) {
X+ 	    /* We cannot trust this group, so we leave it alone */
X+ 	    /* group_menu after update_group will do what is necessary */
X+ 	    continue;
X+ 	}
X  	
X  	if (gh->last_article > gh->last_l_article)
X  	    gh->group_flag |= G_RENUM;	/* mark for use below */
X***************
X*** 420,426 ****
X  int mode;	/* +1 => add, -1 => subtract */
X  {
X      long art;
X!     int was_unread;
X      
X      art = gh->last_l_article - gh->last_article;
X      was_unread = (gh->group_flag & G_UNREAD_COUNT);
X--- 426,432 ----
X  int mode;	/* +1 => add, -1 => subtract */
X  {
X      long art;
X!     int32 was_unread;
X      
X      art = gh->last_l_article - gh->last_article;
X      was_unread = (gh->group_flag & G_UNREAD_COUNT);
X
X*** /usr/storm/nn6.3.3/save.c	Fri Jun 30 11:31:09 1989
X--- save.c	Wed Jul  5 17:00:28 1989
X***************
X*** 259,265 ****
X      
X  #ifdef PAGED_OUTPUT
X      if (save_mode & DO_UNSHAR) {
X! 	int was_raw = no_raw();
X  	pager_stream = popen(pager, "w");
X  	if (was_raw) raw();
X  	
X--- 259,265 ----
X      
X  #ifdef PAGED_OUTPUT
X      if (save_mode & DO_UNSHAR) {
X! 	int was_raw = unset_raw();
X  	pager_stream = popen(pager, "w");
X  	if (was_raw) raw();
X  	
X***************
X*** 329,335 ****
X  		fclose(art);
X  		return 0;
X  	    }
X! 	    was_raw = no_raw();
X  	    if (save_name) 
X  #ifdef PAGED_OUTPUT
X  		sprintf(copybuf, "cd %s && %s %s", save_name, unshar_cmd, pager_redir);
X--- 329,335 ----
X  		fclose(art);
X  		return 0;
X  	    }
X! 	    was_raw = unset_raw();
X  	    if (save_name) 
X  #ifdef PAGED_OUTPUT
X  		sprintf(copybuf, "cd %s && %s %s", save_name, unshar_cmd, pager_redir);
X***************
X*** 383,389 ****
X      }
X  
X      if (mode == FULL_HEADER) {
X! 	int cnt = ah->fpos - ah->hpos;
X  	while (--cnt >= 0) {
X  	    if ((c = getc(art)) == EOF) break;
X  	    putc(c, save_file);
X--- 383,389 ----
X      }
X  
X      if (mode == FULL_HEADER) {
X! 	off_t cnt = ah->fpos - ah->hpos;
X  	while (--cnt >= 0) {
X  	    if ((c = getc(art)) == EOF) break;
X  	    putc(c, save_file);
X
X*** /usr/storm/nn6.3.2/selection.c	Wed Jun 28 20:08:10 1989
X--- selection.c	Sat Jul  8 16:21:37 1989
X***************
X*** 5,11 ****
X  #include "config.h"
X  #include "articles.h"
X  
X! #define	SLMAGIC	0x536c6374
X  #define GNAME_LGT 32
X  
X  static struct sel_header {
X--- 5,11 ----
X  #include "config.h"
X  #include "articles.h"
X  
X! #define	SLMAGIC	0x536c6375
X  #define GNAME_LGT 32
X  
X  static struct sel_header {
X***************
X*** 35,47 ****
X  };
X  
X  
X! save_selection(gh, first, last)
X  group_header *gh;
X  article_number first, last;
X  {
X      register article_header *ah, **ahp;
X!     register int art;
X!     register int save_count, seen_count, flags;
NN_IS_BETTER
echo "End of part 2"
echo "File PATCH.4 is continued in part 3"
echo "3" > s2_seq_.tmp
exit 0

-- 
Kim F. Storm        storm@texas.dk        Tel +45 429 174 00
Texas Instruments, Marielundvej 46E, DK-2730 Herlev, Denmark
	  No news is good news, but nn is better!

storm@texas.dk (Kim F. Storm) (07/10/89)

This is patch #4 for nn 6.3 (part 3 of 3).


#!/bin/sh
# this is part 3 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file PATCH.4 continued
#
CurArch=3
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file PATCH.4"
sed 's/^X//' << 'NN_IS_BETTER' >> PATCH.4
X      struct sel_art elem;
X      FILE *f;
X      char buffer[16];
X--- 35,49 ----
X  };
X  
X  
X! save_selection(gh, first, last, type)
X  group_header *gh;
X  article_number first, last;
X+ int type;
X  {
X      register article_header *ah, **ahp;
X!     register article_number art;
X!     register int save_count, seen_count;
X!     register int32 flags, save_flags;
X      struct sel_art elem;
X      FILE *f;
X      char buffer[16];
X***************
X*** 48,57 ****
X  
X      if (gh->group_flag & (G_FOLDER | G_READ)) return;
X  
X      for (save_count = seen_count = 0, art = n_articles; --art >= 0; ) {
X  	flags = articles[art]->flag; 
X  	if (flags & A_SEEN) seen_count++;
X! 	if (flags & A_SELECT) save_count++;
X      }
X      
X      if (save_count == 0 && 
X--- 50,66 ----
X  
X      if (gh->group_flag & (G_FOLDER | G_READ)) return;
X  
X+     save_flags = A_LEAVE | A_LEAVE_NEXT;
X+     if (type == 0) save_flags |= A_READ;
X+ 	
X      for (save_count = seen_count = 0, art = n_articles; --art >= 0; ) {
X  	flags = articles[art]->flag; 
X  	if (flags & A_SEEN) seen_count++;
X! 	if (flags & A_KILL) continue;
X! 	/* we count only the non-auto selected articles, */
X! 	/* but we still save all selections later if save_count > 0 */
X! 	if ((flags & save_flags) || (flags & (A_SELECT | A_AUTO)) == A_SELECT)
X! 	    save_count++;
X      }
X      
X      if (save_count == 0 && 
X***************
X*** 66,84 ****
X      header.sl_first = htonl(first);
X      header.sl_last  = htonl(last);
X      
X!     fwrite(&header, sizeof(header), 1, f);
X  
X      unsort_articles(1);
X      
X      for (ahp = articles, art = 0; art < n_articles; ahp++, art++) {
X  	ah = *ahp;
X! 	if (elem.sl_flag = htonl(ah->flag & (A_SELECT | A_SEEN))) {
X! 	    
X! 	    elem.sl_number = htonl(ah->a_number);
X! 	    elem.sl_fpos   = htonl(ah->fpos);
X! 	    
X! 	    fwrite(&elem, sizeof(elem), 1, f);
X  	}
X      }
X      
X      fclose(f);
X--- 75,104 ----
X      header.sl_first = htonl(first);
X      header.sl_last  = htonl(last);
X      
X!     fwrite((char *)&header, sizeof(header), 1, f);
X  
X      unsort_articles(1);
X      
X      for (ahp = articles, art = 0; art < n_articles; ahp++, art++) {
X  	ah = *ahp;
X! 	switch (type) {
X! 	 case 0:		/* save current selection */
X! 	    break;
X! 	 case 1:		/* mark seen as read */
X! 	    if (ah->flag & (A_READ | A_SEEN)) continue;
X! 	    break;
X! 	 case 2:		/* leave seen articles unread */
X! 	    if (ah->flag & A_READ) continue;
X! 	    ah->flag &= ~A_SEEN;
X! 	    break;
X  	}
X+ 	if (ah->flag & A_LEAVE_NEXT) ah->flag |= A_LEAVE;
X+ 
X+ 	elem.sl_flag = htonl(ah->flag & (A_SELECT | A_SEEN | A_LEAVE | A_READ));
X+ 	elem.sl_number = htonl(ah->a_number);
X+ 	elem.sl_fpos   = htonl(ah->fpos);
X+ 	    
X+ 	fwrite((char *)&elem, sizeof(elem), 1, f);
X      }
X      
X      fclose(f);
X***************
X*** 102,108 ****
X      f = open_file(relative(nn_directory, buffer), OPEN_READ|OPEN_UNLINK);
X      if (f == NULL) return 0;
X  
X!     if (fread(&header, sizeof(header), 1, f) != 1
X  	|| ntohl(header.sl_magic) != SLMAGIC
X  	|| strncmp(header.sl_group, gh->group_name, GNAME_LGT)) {
X  	fclose(f);
X--- 122,128 ----
X      f = open_file(relative(nn_directory, buffer), OPEN_READ|OPEN_UNLINK);
X      if (f == NULL) return 0;
X  
X!     if (fread((char *)&header, sizeof(header), 1, f) != 1
X  	|| ntohl(header.sl_magic) != SLMAGIC
X  	|| strncmp(header.sl_group, gh->group_name, GNAME_LGT)) {
X  	fclose(f);
X***************
X*** 138,145 ****
X      register long art;
X      struct sel_art elem;
X      register article_header *ah, **ahp;
X! 
X!     if (!ok) goto out;
X      
X      elem.sl_number = -1;
X      
X--- 158,169 ----
X      register long art;
X      struct sel_art elem;
X      register article_header *ah, **ahp;
X!     int do_elim = 0;
X!     
X!     if (!ok) {
X! 	fclose(sel_file);
X! 	return;
X!     }
X      
X      elem.sl_number = -1;
X      
X***************
X*** 149,155 ****
X  	if (ah->a_number > header.sl_last) break;
X      
X  	while (ah->a_number > elem.sl_number) {
X! 	    if (fread(&elem, sizeof(elem), 1, sel_file) != 1) goto out;
X  #ifndef NETWORK_BYTE_ORDER
X  	    elem.sl_number = ntohl(elem.sl_number);
X  #endif
X--- 173,179 ----
X  	if (ah->a_number > header.sl_last) break;
X      
X  	while (ah->a_number > elem.sl_number) {
X! 	    if (fread((char *)&elem, sizeof(elem), 1, sel_file) != 1) goto out;
X  #ifndef NETWORK_BYTE_ORDER
X  	    elem.sl_number = ntohl(elem.sl_number);
X  #endif
X***************
X*** 159,165 ****
X  	elem.sl_fpos = ntohl(elem.sl_fpos);
X  #endif
X  	while (ah->a_number == elem.sl_number && ah->fpos > elem.sl_fpos) {
X! 	    if (fread(&elem, sizeof(elem), 1, sel_file) != 1) goto out;
X  #ifndef NETWORK_BYTE_ORDER
X  	    elem.sl_number = ntohl(elem.sl_number);
X  	    elem.sl_fpos = ntohl(elem.sl_fpos);
X--- 183,189 ----
X  	elem.sl_fpos = ntohl(elem.sl_fpos);
X  #endif
X  	while (ah->a_number == elem.sl_number && ah->fpos > elem.sl_fpos) {
X! 	    if (fread((char *)&elem, sizeof(elem), 1, sel_file) != 1) goto out;
X  #ifndef NETWORK_BYTE_ORDER
X  	    elem.sl_number = ntohl(elem.sl_number);
X  	    elem.sl_fpos = ntohl(elem.sl_fpos);
X***************
X*** 166,179 ****
X  #endif
X  	}
X  	
X! 	if (ah->a_number != elem.sl_number || ah->fpos != elem.sl_fpos) 
X  	    continue;
X! 	
X  	ah->flag |= ntohl(elem.sl_flag);
X      }
X      
X  out:
X! 	
X      fclose(sel_file);
X  }
X  
X--- 190,213 ----
X  #endif
X  	}
X  	
X! 	if (ah->a_number != elem.sl_number || ah->fpos != elem.sl_fpos) {
X! 	    ah->flag |= A_KILL;
X! 	    do_elim = 1;
X  	    continue;
X! 	}	
X  	ah->flag |= ntohl(elem.sl_flag);
X      }
X      
X  out:
X!     for ( ; art < n_articles ; art++) {
X! 	ah = *ahp++;
X! 	if (ah->a_number > header.sl_last) break;
X! 	ah->flag |= A_KILL;
X! 	do_elim = 1;
X!     }
X!     
X!     if (do_elim) elim_articles((article_number *)NULL, 0);
X!     
X      fclose(sel_file);
X  }
X  
X
X*** /usr/storm/nn6.3.2/sequence.c	Wed Jun 28 20:08:11 1989
X--- sequence.c	Sat Jul  8 01:26:22 1989
X***************
X*** 7,12 ****
X--- 7,13 ----
X  
X  export group_header *group_sequence;
X  export char *read_mail = NULL;
X+ export int also_unsub_groups = 0;
X  
X  static int seq_break_enabled = 1;	/* !! enabled */
X  
X***************
X*** 77,83 ****
X  	found = 0;
X  	start_group_search(group);
X  	while (gh = get_group_search()) {
X! 	    if ((gh->group_flag & G_SUBSCRIPTION) == 0) continue;
X  	    found++;
X  	    enter_normal(gh);
X  	}
X--- 78,85 ----
X  	found = 0;
X  	start_group_search(group);
X  	while (gh = get_group_search()) {
X! 	    if ((gh->group_flag & G_SUBSCRIPTION) == 0 && !also_unsub_groups)
X! 		continue;
X  	    found++;
X  	    enter_normal(gh);
X  	}
X***************
X*** 117,123 ****
X      Loop_Groups_Sorted(gh) {
X  	if (gh->group_flag & G_DONE) continue;
X  	
X! 	if ((gh->group_flag & G_SUBSCRIPTION) == 0) continue;
X  
X  	enter_normal(gh);
X      }
X--- 119,126 ----
X      Loop_Groups_Sorted(gh) {
X  	if (gh->group_flag & G_DONE) continue;
X  	
X! 	if ((gh->group_flag & G_SUBSCRIPTION) == 0 && !also_unsub_groups)
X! 	    continue;
X  
X  	enter_normal(gh);
X      }
X***************
X*** 301,307 ****
X  	    gh->save_file = dflt_save;
X  	    
X  	    if (group_name_args == 0 &&
X! 		(gh->group_flag & G_SUBSCRIPTION) == 0) continue;
X  
X  #ifdef SEQ_TEST
X  	    if (Debug & SEQ_TEST && mode != SHOW_NORMAL)
X--- 304,311 ----
X  	    gh->save_file = dflt_save;
X  	    
X  	    if (group_name_args == 0 &&
X! 		(gh->group_flag & G_SUBSCRIPTION) == 0 && !also_unsub_groups)
X! 		continue;
X  
X  #ifdef SEQ_TEST
X  	    if (Debug & SEQ_TEST && mode != SHOW_NORMAL)
X***************
X*** 364,370 ****
X      group_header *gh;
X      
X      gh = (group_header *)calloc(1, sizeof(group_header));
X!     mem_check(gh, 1, "group header");
X      
X      gh->group_name = name;
X      gh->group_flag = flag | G_READ;
X--- 368,374 ----
X      group_header *gh;
X      
X      gh = (group_header *)calloc(1, sizeof(group_header));
X!     mem_check((char *)gh, 1, "group header");
X      
X      gh->group_name = name;
X      gh->group_flag = flag | G_READ;
X***************
X*** 384,389 ****
X--- 388,394 ----
X  #define	GS_SUFFIX	2	/* .group */
X  #define GS_INFIX	3	/* .group. */
X  #define GS_NEW_GROUP	4	/* new group */
X+ #define GS_ALL		5	/* all / . */
X  
X  static start_group_search(group)
X  char *group;
X***************
X*** 393,398 ****
X--- 398,407 ----
X      if (strcmp(group, "NEW") == 0) {
X  	gs_mode = GS_NEW_GROUP;
X  	gs_length = 0;
X+     } else 
X+     if (strcmp(group, "all") == 0 || strcmp(group, ".") == 0) {
X+ 	gs_mode = GS_ALL;
X+ 	gs_length = 0;
X      } else {
X  	gs_mode = GS_PREFIX;
X  	
X***************
X*** 446,451 ****
X--- 455,463 ----
X  	    
X  	 case GS_INFIX:
X  	    user_error(".name. notation not supported (yet)");
X+ 	    break;
X+ 
X+ 	 case GS_ALL:
X  	    break;
X  	}
X  
X
X*** /usr/storm/nn6.3.3/term.c	Fri Jun 30 11:31:10 1989
X--- term.c	Wed Jul  5 16:52:18 1989
X***************
X*** 20,25 ****
X--- 20,26 ----
X  export int  prompt_length;
X  export int  slow_mode = 0;
X  export int  any_message = 0;
X+ export int  flow_control = 1;
X  
X  export char help_key = '?';
X  export char comp1_key = SP;
X***************
X*** 36,41 ****
X--- 37,44 ----
X  
X  #define HAS_CAP(str) (str && *str)
X  
X+ extern char *tgoto();		/* some systems don't have this in term.h */
X+ 
X  #else
X  
X  #define USE_TERMCAP
X***************
X*** 233,239 ****
X  #endif
X      
X  #ifdef USE_TERMINFO
X!     setupterm(0,1,0);
X      Columns = columns;
X      Lines = lines;
X      cookie_size = magic_cookie_glitch;
X--- 236,242 ----
X  #endif
X      
X  #ifdef USE_TERMINFO
X!     setupterm((char *)NULL, 1, (int *)NULL);
X      Columns = columns;
X      Lines = lines;
X      cookie_size = magic_cookie_glitch;
X***************
X*** 521,529 ****
X--- 524,538 ----
X  }
X  
X  static int is_raw = 0;
X+ static int must_set_raw = 1;
X  
X  raw()
X  {
X+     if (!flow_control) {
X+ 	if (!must_set_raw) return;
X+ 	must_set_raw = 0;
X+     }
X+     
X      if (is_raw) return;
X  
X  #ifdef HAVE_TERMIO
X***************
X*** 536,541 ****
X--- 545,552 ----
X  
X  no_raw()
X  {
X+     if (!flow_control) return 0;
X+     
X      if (!is_raw) return 0;
X  
X  #ifdef HAVE_TERMIO
X***************
X*** 546,551 ****
X--- 557,575 ----
X      is_raw = 0;
X  
X      return 1;
X+ }
X+ 
X+ unset_raw()
X+ {
X+     int oflow = flow_control;
X+     int was_raw;
X+     
X+     flow_control = 1;
X+     was_raw = no_raw();
X+     flow_control = oflow;
X+     if (!flow_control)
X+ 	must_set_raw = 1;
X+     return was_raw;
X  }
X  
X  flush_input()
X
X*** /usr/storm/nn6.3.0/term.h	Thu Jun  1 11:11:03 1989
X--- term.h	Wed Jul  5 14:58:50 1989
X***************
X*** 25,30 ****
X--- 25,45 ----
X  
X  extern get_c();
X  
X+ /* special keys returned by get_c() */
X+ 
X+ #define	K_interrupt	CTRL('G')
X+ 
X+ #define	K_up_arrow	0x0081
X+ #define	K_down_arrow	0x0082
X+ #define K_left_arrow	0x0083
X+ #define K_right_arrow	0x0084
X+ 
X+ #define	K_function(n)	(0x0085 + n)
X+ 
X+ 
X+ #define	GETC_COMMAND	0x4000	/* bit set by get_c to return a command */
X+ 
X+ 
X  /*
X   *	prompt_line = ...
X   *	prompt( [P_COMMAND], ] [ format [, arg1 ... , arg4] ] );
X
X*** /usr/storm/nn6.3.3/variable.c	Fri Jun 30 11:31:12 1989
X--- variable.c	Mon Jul 10 11:33:52 1989
X***************
X*** 7,13 ****
X--- 7,16 ----
X  import in_init;
X  
X  import char			/* string variables */
X+     *default_distribution,
X      *default_save_file,
X+     *extra_mail_headers,
X+     *extra_news_headers,
X      *header_lines,
X      *folder_directory,
X      included_mark[],
X***************
X*** 14,22 ****
X      *mail_box,
X      *mail_record,
X      *news_record,
X- #ifdef NNTP
X-     nntp_server[],
X- #endif
X      *pager,
X      *patch_cmd,
X      printer[],
X--- 17,22 ----
X***************
X*** 31,42 ****
X--- 31,45 ----
X      dont_sort_articles,
X      dont_sort_folders,
X      dont_split_digests,
X+     flow_control,
X      fmt_rptsubj,
X+     include_art_id,
X      keep_rc_backup,
X      long_menu,
X      macro_debug,
X      mark_overlap,
X      monitor_mode,
X+     nn_re_style,
X      novice,
X      quick_save,
X      save_report,
X***************
X*** 85,98 ****
X--- 88,104 ----
X      "cross-post",	V_BOOLEAN,	0,	(char **)&also_cross_postings,
X      "date",		V_BOOLEAN,	0,	(char **)&show_article_date,
X      "debug",		V_INTEGER,	0,	(char **)&Debug,
X+     "default-distribution",V_STRING,	0,	(char **)&default_distribution,
X      "default-save-file",V_STRING,	0,	(char **)&default_save_file,
X      "delay-redraw",	V_BOOLEAN,	0,	(char **)&delay_redraw,
X      "erase-key",	V_KEY,		0,	(char **)&erase_key,
X      "expert",		V_BOOLEAN,	4,	(char **)&novice,
X+     "flow-control",	V_BOOLEAN,	0,	(char **)&flow_control,
X      "folder",		V_STRING,	2,	(char **)&folder_directory,
X      "fsort",		V_BOOLEAN,	2,	(char **)&dont_sort_folders,
X      "header-lines",	V_STRING,	0,	(char **)&header_lines,
X      "help-key",		V_KEY,		0,	(char **)&help_key,
X+     "include-art-id",	V_BOOLEAN,	0,	(char **)&include_art_id,
X      "included-mark",	V_STRING,	1,	(char **)included_mark,
X      "kill",		V_BOOLEAN,	0,	(char **)&do_kill_handling,
X      "kill-key",		V_KEY,		0,	(char **)&kill_key,
X***************
X*** 103,116 ****
X      "macro-debug",	V_BOOLEAN,	0,	(char **)&macro_debug,
X      "mail",		V_STRING,	0,	(char **)&mail_box,
X      "mail-format",	V_BOOLEAN,	0,	(char **)&use_mail_folders,
X      "mail-record",	V_STRING,	2,	(char **)&mail_record,
X      "mark-overlap",	V_BOOLEAN,	0,	(char **)&mark_overlap,
X      "monitor",		V_BOOLEAN,	0,	(char **)&monitor_mode,
X      "news-record",	V_STRING,	2,	(char **)&news_record,
X      "newsrc",		V_BOOLEAN,	0,	(char **)&use_newsrc,
X! #ifdef NNTP
X!     "nntp-server",	V_STRING,	1,	(char **)nntp_server,
X! #endif
X      "old",		V_SPECIAL,	2,	(char **)NULL,
X      "overlap",		V_INTEGER,	0,	(char **)&overlap,
X      "pager",		V_STRING,	0,	(char **)&pager,
X--- 109,122 ----
X      "macro-debug",	V_BOOLEAN,	0,	(char **)&macro_debug,
X      "mail",		V_STRING,	0,	(char **)&mail_box,
X      "mail-format",	V_BOOLEAN,	0,	(char **)&use_mail_folders,
X+     "mail-header",	V_STRING,	0,	(char **)&extra_mail_headers,
X      "mail-record",	V_STRING,	2,	(char **)&mail_record,
X      "mark-overlap",	V_BOOLEAN,	0,	(char **)&mark_overlap,
X      "monitor",		V_BOOLEAN,	0,	(char **)&monitor_mode,
X+     "news-header",	V_STRING,	0,	(char **)&extra_news_headers,
X      "news-record",	V_STRING,	2,	(char **)&news_record,
X      "newsrc",		V_BOOLEAN,	0,	(char **)&use_newsrc,
X!     "nn-re-style",	V_BOOLEAN,	0,	(char **)&nn_re_style,
X      "old",		V_SPECIAL,	2,	(char **)NULL,
X      "overlap",		V_INTEGER,	0,	(char **)&overlap,
X      "pager",		V_STRING,	0,	(char **)&pager,
X***************
X*** 171,177 ****
X  int on;
X  char *val_string;
X  {
X!     long value;
X      register struct variable_defs *var;
X  
X      if (strncmp(variable, "no", 2) == 0) {
X--- 177,183 ----
X  int on;
X  char *val_string;
X  {
X!     int value;
X      register struct variable_defs *var;
X  
X      if (strncmp(variable, "no", 2) == 0) {
X***************
X*** 185,191 ****
X      if (!on || val_string == NULL)
X  	value = 0;
X      else	
X! 	value = atol(val_string);
X  
X      switch (var->var_type) {
X  	
X--- 191,197 ----
X      if (!on || val_string == NULL)
X  	value = 0;
X      else	
X! 	value = atoi(val_string);
X  
X      switch (var->var_type) {
X  	
X
X*** /usr/storm/nn6.3.3/xmakefile	Fri Jun 30 11:31:13 1989
X--- xmakefile	Mon Jul 10 11:40:15 1989
X***************
X*** 182,258 ****
X  cvt-help:	cvt-help.c
X  	cc -o cvt-help cvt-help.c
X  
X! active.o:	active.c config.h global.h data.h
X! 
X! admin.o:	admin.c config.h global.h data.h term.h db.h
X! 
X! answer.o:	answer.c config.h global.h data.h news.h term.h keymap.h
X! 
X! articles.o:	articles.c config.h global.h data.h articles.h db.h match.h
X! 
X! collect.o:	collect.c config.h global.h data.h db.h news.h
X! 
X! date_regexp.o:	config.h global.h data.h
X! 
X! db.o:		db.c config.h global.h data.h db.h
X! 
X! decode.o:	decode.c config.h
X! 
X! digest.o:	digest.c config.h global.h data.h news.h match.h
X! 
X! execute.o:	execute.c config.h global.h data.h term.h
X! 
X! expire.o:	expire.c config.h global.h data.h
X! 
X! folder.o:	folder.c config.h global.h data.h articles.h news.h term.h menu.h
X! 
X! global.o:	global.c config.h global.h data.h
X! 
X! group.o:	group.c config.h global.h data.h articles.h db.c term.h menu.h keymap.h
X! 
X! init.o:		init.c config.h global.h data.h articles.h keymap.h term.h menu.h 
X! 
X! keymap.o:	keymap.c config.h global.h data.h keymap.h term.h
X! 
X! kill.o:		kill.c config.h global.h data.h term.h
X! 
X  log_entry.o:	log_entry.c
X! 
X! master.o:	master.c config.h global.h data.h
X! 
X! menu.o:		menu.c config.h global.h data.h articles.h term.h menu.h keymap.h
X! 
X! more.o:		more.c config.h global.h data.h news.h term.h menu.h keymap.h
X! 
X! news.o:		news.c config.h global.h data.h news.h
X! 
X! nn.o:		nn.c config.h global.h data.h menu.h term.h keymap.h
X! 
X! nnmail.o:	nnmail.c config.h global.h data.h options.h
X! 
X! nntp.o:		nntp.c config.h global.h data.h nntp.h
X! 
X! options.o:	options.c config.h global.h data.h options.h
X! 
X! pack_date.o:	pack_date.c config.h global.h data.h
X! 
X! pack_name.o:	pack_name.c config.h global.h data.h
X! 
X! pack_subject.o:	pack_subject.c config.h global.h data.h 
X! 
X! rc.o:		rc.c config.h global.h data.h term.h
X! 
X! reroute.o:	reroute.c config.h global.h data.h
X! 
X! save.o:		save.c config.h global.h data.h term.h news.h keymap.h
X! 
X! selection.o:	selection.c config.h global.h data.h articles.h
X! 
X! sequence.o:	sequence.c config.h global.h data.h
X! 
X! variable.o:	variable.c config.h global.h data.h 
X! 
X! term.o:		term.c config.h global.h data.h term.h keymap.h
X  
X  * link debugging version
X  
X--- 182,240 ----
X  cvt-help:	cvt-help.c
X  	cc -o cvt-help cvt-help.c
X  
X! active.o:	active.c config.h global.h vararg.h data.h
X! admin.o:	admin.c config.h global.h vararg.h data.h db.h term.h
X! answer.o:	answer.c config.h global.h vararg.h data.h news.h term.h \
X! 		keymap.h
X! articles.o:	articles.c config.h global.h vararg.h data.h db.h articles.h \
X! 		match.h
X! collect.o:	collect.c config.h global.h vararg.h data.h db.h news.h
X! cvt-help.o:	cvt-help.c
X! date_regexp.o:	date_regexp.c config.h global.h vararg.h data.h
X! db.o:		db.c config.h global.h vararg.h data.h db.h
X! decode.o:	decode.c config.h global.h vararg.h data.h
X! digest.o:	digest.c config.h global.h vararg.h data.h news.h match.h  \
X! 		debug.h
X! execute.o:	execute.c config.h global.h vararg.h data.h term.h
X! expire.o:	expire.c config.h global.h vararg.h data.h db.h
X! folder.o:	folder.c config.h global.h vararg.h data.h articles.h news.h \
X! 		term.h menu.h
X! global.o:	global.c config.h global.h vararg.h data.h
X! group.o:	group.c config.h global.h vararg.h data.h articles.h db.h \
X! 		term.h menu.h keymap.h regexp.h
X! init.o:		init.c config.h global.h vararg.h data.h articles.h term.h \
X! 		keymap.h menu.h
X! keymap.o:	keymap.c config.h global.h vararg.h data.h keymap.h term.h
X! kill.o:		kill.c config.h global.h vararg.h data.h term.h regexp.h
X  log_entry.o:	log_entry.c
X! macro.o:	macro.c config.h global.h vararg.h data.h keymap.h term.h
X! master.o:	master.c config.h global.h vararg.h data.h db.h options.h
X! match.o:	match.c
X! menu.o:		menu.c config.h global.h vararg.h data.h articles.h term.h \
X! 		keymap.h menu.h regexp.h
X! more.o:		more.c config.h global.h vararg.h data.h news.h term.h \
X! 		menu.h keymap.h regexp.h
X! news.o:		news.c config.h global.h vararg.h data.h news.h
X! nn.o:		nn.c config.h global.h vararg.h data.h menu.h term.h \
X! 		keymap.h options.h
X! nnmail.o:	nnmail.c config.h global.h vararg.h data.h options.h
X! nntp.o:		nntp.c config.h global.h vararg.h data.h nntp.h
X! options.o:	options.c config.h global.h vararg.h data.h options.h
X! pack_date.o:	pack_date.c config.h global.h vararg.h data.h
X! pack_name.o:	pack_name.c config.h global.h vararg.h data.h
X! pack_subject.o:	pack_subject.c config.h global.h vararg.h data.h
X! rc.o:		rc.c config.h global.h vararg.h data.h term.h debug.h
X! regexp.o:	regexp.c config.h global.h vararg.h data.h regexp.h
X! reroute.o:	reroute.c config.h global.h vararg.h data.h
X! save.o:		save.c config.h global.h vararg.h data.h term.h keymap.h \
X! 		news.h
X! selection.o:	selection.c config.h global.h vararg.h data.h term.h\
X! 		 articles.h
X! sequence.o:	sequence.c config.h global.h vararg.h data.h debug.h
X! term.o:		term.c config.h global.h vararg.h data.h term.h keymap.h
X! unshar.o:	unshar.c config.h global.h vararg.h data.h
X! update.o:	update.c patchlevel.h update.h
X! variable.o:	variable.c config.h global.h vararg.h data.h
X  
X  * link debugging version
X  
X
NN_IS_BETTER
echo "File PATCH.4 is complete"
chmod 0644 PATCH.4 || echo "restore of PATCH.4 fails"
set `wc -c PATCH.4`;Sum=$1
if test "$Sum" != "114443"
then echo original size 114443, current size $Sum;fi
echo "x - extracting s-aux1-1.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > s-aux1-1.h &&
X/*
X *	This version is for A/UX 1.1 (approx. System V Release 3.1)
X */
X
X
X/*
X *	Include header files containing the following definitions:
X *
X * 		off_t, time_t, struct stat
X */
X
X#include <sys/types.h>
X#include <sys/stat.h>
X
X/*
X *	Define if your system has system V like ioctls
X */
X
X#define	HAVE_TERMIO			/* */
X
X/*
X *	Define to use terminfo database.
X *	Otherwise, termcap is used
X */
X
X#define	USE_TERMINFO			/* */
X
X/*
X *	Specify the library containing the termcap/terminfo access routines.
X *	Notice:  nn does not use curses.
X *	Notice:  You must also specify whether termcap or terminfo is
X *		 used when you edit config.h (see below).
X */
X
X#define	TERMLIB -lcurses
X
X/*
X *	Define HAVE_STRCHR if strchr() and strrchr() are available
X */
X
X#define HAVE_STRCHR			/* */
X
X/*
X *	Define if a signal handler has type void (see signal.h)
X */
X
X#define	SIGNAL_HANDLERS_ARE_VOID	/* */
X
X/*
X *	Define if signals must be set again after they are caught
X */
X
X#define	RESET_SIGNAL_WHEN_CAUGHT	/* */
X
X/*
X *	Define MICRO_ALARM to timeout in 0.1 seconds if possible
X */
X
X#define MICRO_ALARM()	alarm(1)	/* System V */
X
X/*
X *	Define if your system has BSD like job control (SIGTSTP works)
X */
X
X#define HAVE_JOBCONTROL			/* */
X
X/*
X *	Define if your system provides the "directory(3X)" access routines
X *
X *	If true, include the header file(s) required by the package below
X *	(remember that <sys/types.h> or equivalent is included above)
X *	Also typedef Direntry to the proper struct type.
X */
X
X#define	HAVE_DIRECTORY			/* */
X
X#include <sys/dir.h>			/* A/UX */
X
Xtypedef struct direct Direntry;		/* System V */
X
X/*
X *	Define if your system has a mkdir() library routine
X */
X
X#define	HAVE_MKDIR			/* */
X
X/*
X *	Define HAVE_GETHOSTNAME if your system provides a BSD like 
X *	gethostname routine.
X *	Otherwise, define HAVE_UNAME if uname() is avaiable.
X *	As a final resort, define HOSTNAME to the name of your system.
X */
X
X#define	HAVE_UNAME			/* System V */
X
X/*
X *	Define DETATCH_TERMINAL to be a command sequence which 
X *	will detatch a process from the control terminal
X *	Also include files needed to perform this HERE.
X *	If not possible, just define it (empty)
X */
X
X#define	DETATCH_TERMINAL setpgrp();	/* System V */
X
X/* 
X *	Specify where the Bourne Shell is.
X */
X
X#define SHELL		"/bin/sh"
X
X/*
X *	Specify the default mailer to be invoked by nnmail
X */
X
X#define	MAILX		"/usr/bin/mailx"	/* SV */
X
X/*
X *	Specify the default pager & options.
X */
X
X#define	PAGER		"pg -n -s"
X
X/*
X *	Specify the default print command and options.
X */
X
X#define	PRINTER		"lp -s"
X
X
X/*
X *	Define the maximum length of any pathname that may occur
X */
X
X#define	FILENAME 	128
X
NN_IS_BETTER
chmod 0644 s-aux1-1.h || echo "restore of s-aux1-1.h fails"
set `wc -c s-aux1-1.h`;Sum=$1
if test "$Sum" != "2625"
then echo original size 2625, current size $Sum;fi
echo "x - extracting s-dynix3-0.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > s-dynix3-0.h &&
X/*
X *	This version is for Dynix 3.0 systems
X */
X
X
X/*
X *	Include haeder files containing the following definitions:
X *
X * 		off_t, time_t, struct stat
X */
X
X#include <sys/types.h>
X#include <sys/stat.h>
X
X
X/*
X *	Define if your system has system V like ioctls
X */
X
X#undef	HAVE_TERMIO			/* */
X
X/*
X *	Define to use terminfo database.
X *	Otherwise, termcap is used
X */
X
X#undef	USE_TERMINFO			/* */
X
X/*
X *	Specify the library (or libraries) containing the termcap/terminfo
X *	routines.
X *
X *	Notice:  nn only uses the low-level terminal access routines
X *	(i.e. it does not use curses).
X */
X
X#define TERMLIB	-ltermlib
X
X/*
X *	Define HAVE_STRCHR if strchr() and strrchr() are available
X */
X
X#include <string.h>
X
X#undef HAVE_STRCHR			/* */
X
X/*
X *	Define if a signal handler has type void (see signal.h)
X */
X
X#undef	SIGNAL_HANDLERS_ARE_VOID	/* */
X
X/*
X *	Define MICRO_ALARM to timeout in 0.1 seconds if possible
X */
X
X#define MICRO_ALARM()	alarm(1)	/* could use setitimer ... */
X
X/*
X *	Define if your system has BSD like job control (SIGTSTP works)
X */
X
X#define HAVE_JOBCONTROL			/* */
X
X/*
X *	Define if your system provides the "directory(3X)" access routines
X *
X *	If true, include the header file(s) required by the package below
X *	(remember that <sys/types.h> or equivalent is included above)
X *	Also typedef Direntry to the proper struct type.
X */
X
X#define	HAVE_DIRECTORY			/* */
X
X#include <sys/dir.h>			/* BSD */
X
Xtypedef struct direct Direntry;		/* BSD */
X
X/*
X *	Define if your system has a mkdir() library routine
X */
X
X#define	HAVE_MKDIR			/* */
X
X/*
X *	Define if your system provides a BSD like gethostname routine.
X *	Otherwise, define HAVE_UNAME if uname() is avaiable.
X */
X
X#define	HAVE_GETHOSTNAME	/* BSD systems */
X
X/*
X *	Define DETATCH_TERMINAL to be a command sequence which 
X *	will detatch a process from the control terminal
X *	Also include system files needed to perform this HERE.
X *	If not possible, just define it (empty)
X */
X
X#include <sys/file.h>	/* for O_RDONLY */
X#include <sys/ioctl.h>	/* for TIOCNOTTY */
X
X#define	DETATCH_TERMINAL \
X    { int t = open("/dev/tty", O_RDONLY); \
X	  if (t >= 0) ioctl(t, TIOCNOTTY, (int *)0), close(t); }
X
X      
X/* 
X *	Specify where the Bourne Shell is.
X */
X
X#define SHELL		"/bin/sh"
X
X/*
X *	Specify the default mailer to be invoked by nnmail
X */
X
X#define	MAILX	"/usr/ucb/Mail"		/* BSD */
X
X
X/*
X *	Specify the default pager & options.
X */
X
X#define	PAGER		"more"
X
X/*
X *	Specify the default print command and options.
X */
X
X#define	PRINTER		"imprint"
X
X
X/*
X *	Define the maximum length of any pathname that may occur
X */
X
X#define	FILENAME 	256
X
X/*
X * Extra libraries needed on the Symmetry
X */
X
X#define EXTRA_LIB
NN_IS_BETTER
chmod 0644 s-dynix3-0.h || echo "restore of s-dynix3-0.h fails"
set `wc -c s-dynix3-0.h`;Sum=$1
if test "$Sum" != "2651"
then echo original size 2651, current size $Sum;fi
echo "x - extracting s-fortune.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > s-fortune.h &&
X*******************************************************************
X/*
X *	This file is for Fortune 32:16 systems.
X *	Use with m-m680x0.h file, but requires STRCSPN in config.h
X *	The Fortune may have problems with the nested #ifdef:s in
X *	regexp.c (STRCSPN + __STDC__).  If so remove the __STDC__ ifdef.
X *
X *	From thewev!root, July 9, 1989.
X */
X
X
X/*
X *	Include header files containing the following definitions:
X *
X * 		off_t, time_t, struct stat
X */
X
X#include <sys/types.h>
X#include <stat.h>
X
X
X/*
X *	Define if your system has system V like ioctls
X */
X
X/* #define	HAVE_TERMIO			/* */
X
X/*
X *	Define to use terminfo database.
X *	Otherwise, termcap is used
X */
X
X/* #define	USE_TERMINFO			/* */
X
X/*
X *	Specify the library (or libraries) containing the termcap/terminfo
X *	routines.
X *
X *	Notice:  nn only uses the low-level terminal access routines
X *	(i.e. it does not use curses).
X */
X
X#define TERMLIB	-ltermlib
X
X/*
X *	Define HAVE_STRCHR if strchr() and strrchr() are available
X */
X
X/* #define HAVE_STRCHR			/* */
X
X/*
X *	Define if a signal handler has type void (see signal.h)
X */
X
X/* #define	SIGNAL_HANDLERS_ARE_VOID	/* */
X
X/*
X *	Define if signals must be set again after they are caught
X */
X
X#define	RESET_SIGNAL_WHEN_CAUGHT	/* */
X
X/*
X *	Define MICRO_ALARM to timeout in 0.1 seconds if possible
X */
X
X#define MICRO_ALARM()	alarm(1)	/* System V */
X/*#define MICRO_ALARM()	ualarm(100000,0)	/* BSD 4.3 */
X 
X/*
X *	Define if your system has BSD like job control (SIGTSTP works)
X */
X
X/* #define HAVE_JOBCONTROL			/* */
X
X
X/*
X *	Define if your system has a 4.3BSD like syslog library.
X */
X
X#undef HAVE_SYSLOG
X
X/*
X *	Define if your system provides the "directory(3X)" access routines
X *
X *	If true, include the header file(s) required by the package below
X *	(remember that <sys/types.h> or equivalent is included above)
X *	Also typedef Direntry to the proper struct type.
X */
X
X/* #define	HAVE_DIRECTORY			/* */
X
X/* #include <dirent.h>			/* System V */
X#include <sys/dir.h>				/* BSD */
X
X/* typedef struct dirent Direntry;		/* System V */
Xtypedef struct direct Direntry;		/* BSD */
X
X/*
X *	Define if your system has a mkdir() library routine
X */
X
X#define	HAVE_MKDIR			/* */
X
X
X/*
X *	Define HAVE_GETHOSTNAME if your system provides a BSD like 
X *	gethostname routine.
X *	Otherwise, define HAVE_UNAME if uname() is avaiable.
X *	As a final resort, define HOSTNAME to the name of your system 
X *	(in config.h).
X */
X
X/* #define	HAVE_GETHOSTNAME	/* BSD systems */
X
X/* #define	HAVE_UNAME			/* System V */
X
X/*
X *	Define DETATCH_TERMINAL to be a command sequence which 
X *	will detatch a process from the control terminal
X *	Also include system files needed to perform this HERE.
X *	If not possible, just define it (empty)
X */
X
X/* #include "...." */
X
X#define	DETATCH_TERMINAL /* setpgrp(); */
X
X
X/* 
X *	Specify where the Bourne Shell is.
X */
X
X#define SHELL		"/bin/sh"
X
X/*
X *	Specify the default mailer to be invoked by nnmail
X */
X
X#define	MAILX		"/bin/mail"	/* FOR:PRO */
X/* #define	MAILX	"/usr/ucb/Mail"		/* BSD */
X
X
X/*
X *	Specify the default pager & options.
X */
X
X#define	PAGER		"/usr/bin/less -s"
X
X/*
X *	Specify the default print command and options.
X */
X
X#define	PRINTER		"/usr/bin/lpr -s"
X
X
X/*
X *	Define the maximum length of any pathname that may occur
X */
X
X#define	FILENAME 	128
X
X
X/*
X *	Define standard compiler flags here:
X */
X
X#define COMPILER_FLAGS -O
X
X/*
X *	If your system requires other libraries when linking nn
X *	specify them here:
X */
X
X#define EXTRA_LIB
NN_IS_BETTER
chmod 0644 s-fortune.h || echo "restore of s-fortune.h fails"
set `wc -c s-fortune.h`;Sum=$1
if test "$Sum" != "3450"
then echo original size 3450, current size $Sum;fi
echo "x - extracting s-sgi4D.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > s-sgi4D.h &&
X/*
X *	This file is for a Silicon Graphics 4D series machines
X *  Running IRIX 3.1 or 3.2.  (HAVE_JOBCTRL should only be
X *	defined if you have 3.2)
X */
X
X
X/*
X *	Include header files containing the following definitions:
X *
X * 		off_t, time_t, struct stat
X */
X
X#include <sys/types.h>
X#include <sys/stat.h>
X
X/*
X *	Define if your system has system V like ioctls
X */
X
X#define	HAVE_TERMIO			/* */
X
X/*
X *	Define to use terminfo database.
X *	Otherwise, termcap is used
X */
X
X#define	USE_TERMINFO			/* */
X
X/*
X *	Specify the library containing the termcap/terminfo access routines.
X *	Notice:  nn does not use curses.
X *	Notice:  You must also specify whether termcap or terminfo is
X *		 used when you edit config.h (see below).
X */
X
X#define	TERMLIB -lcurses
X
X/*
X *	Define HAVE_STRCHR if strchr() and strrchr() are available
X */
X
X#define HAVE_STRCHR			/* */
X
X/*
X *	Define if a signal handler has type void (see signal.h)
X */
X
X#define	SIGNAL_HANDLERS_ARE_VOID	/* */
X
X/*
X *	Define if signals must be set again after they are caught
X */
X
X#define	RESET_SIGNAL_WHEN_CAUGHT	/* */
X
X/*
X *	Define MICRO_ALARM to timeout in 0.1 seconds if possible
X */
X
X#define MICRO_ALARM()	alarm(1)	/* System V */
X
X/*
X *	Define if your system has BSD like job control (SIGTSTP works)
X */
X
X#define HAVE_JOBCONTROL			/* */
X
X/*
X *	Define if your system has a 4.3BSD like syslog library.
X */
X
X#define HAVE_SYSLOG
X
X/*
X *	Define if your system provides the "directory(3X)" access routines
X *
X *	If true, include the header file(s) required by the package below
X *	(remember that <sys/types.h> or equivalent is included above)
X *	Also typedef Direntry to the proper struct type.
X */
X
X#define	HAVE_DIRECTORY			/* */
X
X#include <dirent.h>			/* System V */
X
Xtypedef struct dirent Direntry;		/* System V */
X
X/*
X *	Define if your system has a mkdir() library routine
X */
X
X#define	HAVE_MKDIR			/* */
X
X/*
X *	Define HAVE_GETHOSTNAME if your system provides a BSD like 
X *	gethostname routine.
X *	Otherwise, define HAVE_UNAME if uname() is avaiable.
X *	As a final resort, define HOSTNAME to the name of your system.
X */
X
X#define	HAVE_GETHOSTNAME			/* System V */
X
X/*
X *	Define DETATCH_TERMINAL to be a command sequence which 
X *	will detatch a process from the control terminal
X *	Also include files needed to perform this HERE.
X *	If not possible, just define it (empty)
X */
X
X#define	DETATCH_TERMINAL setpgrp();	/* System V */
X
X/* 
X *	Specify where the Bourne Shell is.
X */
X
X#define SHELL		"/bin/sh"
X
X/*
X *	Specify the default mailer to be invoked by nnmail
X */
X
X#define	MAILX		"/usr/bsd/Mail"
X
X/*
X *	Specify the default pager & options.
X */
X
X#define	PAGER		"more"
X
X/*
X *	Specify the default print command and options.
X */
X
X#define	PRINTER		"lp -s"
X
X/*
X *	Define standard compiler flags here:
X */
X
X#define COMPILER_FLAGS -O -I/usr/include/bsd
X
X
X/*
X *	Define the maximum length of any pathname that may occur
X */
X
X#define	FILENAME 	1024	/* really should be from limits.h */
X
X/*
X *	If your system requires other libraries when linking nn
X *	specify them here:  (use shared C library for reduced
X *	size and portability across releases).
X */
X
X#define EXTRA_LIB -lbsd -lc_s
NN_IS_BETTER
chmod 0644 s-sgi4D.h || echo "restore of s-sgi4D.h fails"
set `wc -c s-sgi4D.h`;Sum=$1
if test "$Sum" != "3118"
then echo original size 3118, current size $Sum;fi
echo "x - extracting s-uport2-2.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > s-uport2-2.h &&
X/*
X *	This version is for Microport UNIX V.2 machines.
X */
X
X
X/*
X *	Include header files containing the following definitions:
X *
X * 		off_t, time_t, struct stat
X */
X
X#include <sys/types.h>
X#include <sys/stat.h>
X
X/*
X *	Define if your system has system V like ioctls
X */
X
X#define	HAVE_TERMIO			/* */
X
X/*
X *	Define to use terminfo database.
X *	Otherwise, termcap is used
X */
X
X#define	USE_TERMINFO			/* */
X
X/*
X *	Specify the library containing the termcap/terminfo access routines.
X *	Notice:  nn does not use curses.
X *	Notice:  You must also specify whether termcap or terminfo is
X *		 used when you edit config.h (see below).
X */
X
X#define	TERMLIB -lcurses
X
X/*
X *	Define HAVE_STRCHR if strchr() and strrchr() are available
X */
X
X#define HAVE_STRCHR			/* */
X
X/*
X *	Define if a signal handler has type void (see signal.h)
X */
X
X/* #define	SIGNAL_HANDLERS_ARE_VOID	/* */
X
X/*
X *	Define if signals must be set again after they are caught
X */
X
X#define	RESET_SIGNAL_WHEN_CAUGHT	/* */
X
X/*
X *	Define MICRO_ALARM to timeout in 0.1 seconds if possible
X */
X
X#define MICRO_ALARM()	alarm(1)	/* System V */
X
X/*
X *	Define if your system has BSD like job control (SIGTSTP works)
X */
X
X/* #define HAVE_JOBCONTROL			/* */
X
X/*
X *	Define if your system provides the "directory(3X)" access routines
X *
X *	If true, include the header file(s) required by the package below
X *	(remember that <sys/types.h> or equivalent is included above)
X *	Also typedef Direntry to the proper struct type.
X */
X
X/* #define	HAVE_DIRECTORY			/* */
X
X/* #include <dirent.h>			/* System V */
X
X/* typedef struct dirent Direntry;		/* System V */
X
X/*
X *	Define if your system has a mkdir() library routine
X */
X
X/* #define	HAVE_MKDIR			/* */
X
X/*
X *	Define HAVE_GETHOSTNAME if your system provides a BSD like 
X *	gethostname routine.
X *	Otherwise, define HAVE_UNAME if uname() is avaiable.
X *	As a final resort, define HOSTNAME to the name of your system.
X */
X
X#define	HAVE_UNAME			/* System V */
X
X/*
X *	Define DETATCH_TERMINAL to be a command sequence which 
X *	will detatch a process from the control terminal
X *	Also include files needed to perform this HERE.
X *	If not possible, just define it (empty)
X */
X
X#define	DETATCH_TERMINAL setpgrp();	/* System V */
X
X/* 
X *	Specify where the Bourne Shell is.
X */
X
X#define SHELL		"/bin/ksh"
X
X/*
X *	Specify the default mailer to be invoked by nnmail
X */
X
X#define	MAILX		"/usr/bin/mailx"	/* SV */
X
X/*
X *	Specify the default pager & options.
X */
X
X#define	PAGER		"pg -n -s"
X
X/*
X *	Specify the default print command and options.
X */
X
X#define	PRINTER		"lp -s"
X
X
X/*
X *	Define the maximum length of any pathname that may occur
X */
X
X#define	FILENAME 	128
X
X/*
X *	Use P.D. malloc library for the 286.
X *	This may not be needed if you don't have it...
X */
X
X#define EXTRA_LIB	 -lm286
NN_IS_BETTER
chmod 0644 s-uport2-2.h || echo "restore of s-uport2-2.h fails"
set `wc -c s-uport2-2.h`;Sum=$1
if test "$Sum" != "2760"
then echo original size 2760, current size $Sum;fi
echo "x - extracting s-xenix386.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > s-xenix386.h &&
X/*
X *  Thu Jun 29 18:55:47 1989 - Chip Rosenthal <chip@vector.Dallas.TX.US>
X *	Generated SCO XENIX/386 version from "s-template.h".  XENIX has
X *	both "termcap" and "terminfo".  This version reflects the local
X *	preference for "termcap".
X */
X
X
X/*
X *	Include header files containing the following definitions:
X *
X * 		off_t, time_t, struct stat
X */
X
X#include <sys/types.h>
X#include <sys/stat.h>
X
X
X/*
X *	Define if your system has system V like ioctls
X */
X
X#define	HAVE_TERMIO			/* */
X
X/*
X *	Define to use terminfo database.
X *	Otherwise, termcap is used
X */
X
X/* #define	USE_TERMINFO			/* */
X
X/*
X *	Specify the library (or libraries) containing the termcap/terminfo
X *	routines.
X *
X *	Notice:  nn only uses the low-level terminal access routines
X *	(i.e. it does not use curses).
X */
X
X#define TERMLIB	-ltermlib
X
X/*
X *	Define HAVE_STRCHR if strchr() and strrchr() are available
X */
X
X#define HAVE_STRCHR			/* */
X
X/*
X *	Define if a signal handler has type void (see signal.h)
X */
X
X/* #define	SIGNAL_HANDLERS_ARE_VOID	/* */
X
X/*
X *	Define if signals must be set again after they are caught
X */
X
X#define	RESET_SIGNAL_WHEN_CAUGHT	/* */
X
X/*
X *	Define MICRO_ALARM to timeout in 0.1 seconds if possible
X */
X
X#define MICRO_ALARM()	alarm(1)	/* System V */
X 
X/*
X *	Define if your system has BSD like job control (SIGTSTP works)
X */
X
X/* #define HAVE_JOBCONTROL			/* */
X
X
X/*
X *	Define if your system has a 4.3BSD like syslog library.
X */
X
X#undef HAVE_SYSLOG
X
X/*
X *	Define if your system provides the "directory(3X)" access routines
X *
X *	If true, include the header file(s) required by the package below
X *	(remember that <sys/types.h> or equivalent is included above)
X *	Also typedef Direntry to the proper struct type.
X */
X
X#define	HAVE_DIRECTORY			/* */
X
X#include <sys/ndir.h>			/* SCO XENIX */
X
Xtypedef struct direct Direntry;		/* BSD and SCO XENIX */
X
X/*
X *	Define if your system has a mkdir() library routine
X */
X
X/* #define	HAVE_MKDIR			/* */
X
X
X/*
X *	Define HAVE_GETHOSTNAME if your system provides a BSD like 
X *	gethostname routine.
X *	Otherwise, define HAVE_UNAME if uname() is avaiable.
X *	As a final resort, define HOSTNAME to the name of your system 
X *	(in config.h).
X */
X
X#define	HAVE_UNAME			/* System V */
X
X/*
X *	Define DETATCH_TERMINAL to be a command sequence which 
X *	will detatch a process from the control terminal
X *	Also include system files needed to perform this HERE.
X *	If not possible, just define it (empty)
X */
X
X#define	DETATCH_TERMINAL /* setpgrp(); */
X
X
X/* 
X *	Specify where the Bourne Shell is.
X */
X
X#define SHELL		"/bin/sh"
X
X/*
X *	Specify the default mailer to be invoked by nnmail
X */
X
X/* #define	MAILX		"/usr/bin/mailx"	/* SV */
X/* #define	MAILX	"/usr/ucb/Mail"		/* BSD */
X#define		MAILX	"/usr/bin/mail"		/* SCO XENIX */
X
X
X/*
X *	Specify the default pager & options.
X */
X
X/* #define	PAGER		"/usr/bin/pg -n -s"	/* */
X#define		PAGER		"/usr/bin/more"	/* SCO XENIX */
X
X/*
X *	Specify the default print command and options.
X */
X
X#define	PRINTER		"/usr/bin/lp -s"
X
X
X/*
X *	Define the maximum length of any pathname that may occur
X */
X
X#define	FILENAME 	128
X
X
X/*
X *	Define standard compiler flags here:
X */
X
X#define COMPILER_FLAGS	-O
X
X/*
X *	If your system requires other libraries when linking nn
X *	specify them here:
X */
X
X#define EXTRA_LIB	-lx
NN_IS_BETTER
chmod 0644 s-xenix386.h || echo "restore of s-xenix386.h fails"
set `wc -c s-xenix386.h`;Sum=$1
if test "$Sum" != "3257"
then echo original size 3257, current size $Sum;fi
echo "x - extracting m-convex.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > m-convex.h &&
X/************** Machine (and compiler) dependent definitions. **************
X *
X *	Define appropriate types for the following ranges of integer
X *	variables.  These are processor & compiler dependent, but the
X *	distributed definitions will probably work on most systems.
X */
X
X
X
X/*      MACHINE TYPE	DEFINED TYPE		VALUE RANGE	*/
X
Xtypedef unsigned char	int8;		/*        0 ..     255 */
Xtypedef short		int16;		/*  -10,000 ..  10,000 */
Xtypedef long		int32;		/* -100,000 .. 100,000 */
Xtypedef unsigned long	uint32;		/* 	  0 ..  2^31-1 */
X
X
X/*
X * 	Define NO_VARARGS if the varargs feature is not available
X *
X *	Also define NO_VARARGS if the vprintf/vsprintf routines are not
X *	available (however, this will only by safe on some machines, like
X *	the VAX).
X *	
X */
X
X#define NO_VARARGS
X
X/*
X *	Define STRCSPN if the strcspn() function is not available.
X */
X
X#define STRCSPN 	/* */
X
X/*
X *	Define NO_SIGINTERRUPT on BSD based systems which don't have
X *	a siginterrupt() function, but provides an SV_INTERRUPT flag
X *	in <signal.h>.
X */
X
X#define NO_SIGINTERRUPT	/* */
X
X
X/*
X *	Define NETWORK_BYTE_ORDER if the machine's int32's are
X *	already in network byte order, i.e. m68k based.
X */
X
X#define NETWORK_BYTE_ORDER	/* */
NN_IS_BETTER
chmod 0644 m-convex.h || echo "restore of m-convex.h fails"
set `wc -c m-convex.h`;Sum=$1
if test "$Sum" != "1213"
then echo original size 1213, current size $Sum;fi
echo "x - extracting m-i80286.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > m-i80286.h &&
X/************** Machine (and compiler) dependent definitions. **************
X *
X *	This is for the Intel 80286 processor.
X */
X
X
X
X/*      MACHINE TYPE	DEFINED TYPE		VALUE RANGE	*/
X
Xtypedef unsigned char	int8;		/*        0 ..     255 */
Xtypedef short		int16;		/*  -10,000 ..  10,000 */
Xtypedef long		int32;		/* -100,000 .. 100,000 */
Xtypedef unsigned long	uint32;		/* 	  0 ..  2^31-1 */
X
X
X/*
X * 	Define NO_VARARGS if the varargs feature is not available
X *
X *	Also define NO_VARARGS if the vprintf/vsprintf routines are not
X *	available (however, this will only by safe on some machines, like
X *	the VAX).
X *	
X */
X
X/* #define NO_VARARGS */
X
X
X
X#ifdef NETWORK_DATABASE
X
X/*
X *	Define NETWORK_BYTE_ORDER if the machine's int32's are
X *	already in network byte order, i.e. m68k based.
X */
X
X/* #define NETWORK_BYTE_ORDER	/* THEY ARE NOT */
X
X/*
X * Include appropriate files or define macroes or functions (include them 
X * in data.c) to convert longs and shorts to and from network byte order.
X *
X * Needs byte swapping here!
X */
X
XYOU LOSE -- HOW IS THIS DONE ON THE 286?
X
X/*
X * define something appropriate below
X */
X
X#define htonl(l)	...	/* host long to network long */
X#define ntohl(l)	...	/* network long to host long */
X
X#endif	/* NETWORK DATABASE */
NN_IS_BETTER
chmod 0644 m-i80286.h || echo "restore of m-i80286.h fails"
set `wc -c m-i80286.h`;Sum=$1
if test "$Sum" != "1247"
then echo original size 1247, current size $Sum;fi
echo "x - extracting m-sgi4D.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > m-sgi4D.h &&
X/************** Machine (and compiler) dependent definitions. **************
X *
X *	This file is for a Silicon Graphics 4D series machines
X */
X
X/*      MACHINE TYPE	DEFINED TYPE		VALUE RANGE	*/
X
Xtypedef unsigned char	int8;		/*        0 ..     255 */
Xtypedef short		int16;		/*  -10,000 ..  10,000 */
Xtypedef long		int32;		/* -100,000 .. 100,000 */
Xtypedef unsigned long	uint32;		/* 	  0 ..  2^31-1 */
X
X#undef NO_VARARGS
X
X#ifdef NETWORK_DATABASE
X#undef NETWORK_BYTE_ORDER
X#include <netinet/in.h>
X#endif	/* NETWORK DATABASE */
NN_IS_BETTER
chmod 0644 m-sgi4D.h || echo "restore of m-sgi4D.h fails"
set `wc -c m-sgi4D.h`;Sum=$1
if test "$Sum" != "523"
then echo original size 523, current size $Sum;fi
echo "x - extracting m-symmetry.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > m-symmetry.h &&
X/************** Machine (and compiler) dependent definitions. **************
X *
X *	This file is for the Symmetry.
X *	Use with s-dynix3-0.h.
X */
X
X
X
X/*      MACHINE TYPE	DEFINED TYPE		VALUE RANGE	*/
X
Xtypedef unsigned char	int8;		/*        0 ..     255 */
Xtypedef short		int16;		/*  -10,000 ..  10,000 */
Xtypedef long		int32;		/* -100,000 .. 100,000 */
Xtypedef unsigned long	uint32;		/* 	  0 ..  2^31-1 */
X
X/*
X * The Symmetry C compiler lacks vprintf/vsprintf and strcspn
X */
X
X#define NO_VARARGS
X#define STRCSPN
X
X/*
X *	Not in network byte order on the 386
X */
X
X#undef NETWORK_BYTE_ORDER	/* */
X#if defined(NNTP) || defined(NETWORK_DATABASE)
X#include <netinet/in.h>
X#endif
NN_IS_BETTER
chmod 0644 m-symmetry.h || echo "restore of m-symmetry.h fails"
set `wc -c m-symmetry.h`;Sum=$1
if test "$Sum" != "668"
then echo original size 668, current size $Sum;fi
echo "x - extracting m-xenix386.h (Text)"
sed 's/^X//' << 'NN_IS_BETTER' > m-xenix386.h &&
X/************** Machine (and compiler) dependent definitions. **************
X *
X *	This file is for XENIX 386.
X */
X
X
X
X/*      MACHINE TYPE	DEFINED TYPE		VALUE RANGE	*/
X
Xtypedef unsigned char	int8;		/*        0 ..     255 */
Xtypedef short		int16;		/*  -10,000 ..  10,000 */
Xtypedef long		int32;		/* -100,000 .. 100,000 */
Xtypedef unsigned long	uint32;		/* 	  0 ..  2^31-1 */
X
X
X/*
X * 	Define NO_VARARGS if the varargs feature is not available
X *
X *	Also define NO_VARARGS if the vprintf/vsprintf routines are not
X *	available (however, this will only by safe on some machines, like
X *	the VAX).
X *	
X */
X
X/* #define NO_VARARGS */
X
X/*
X *	Define STRCSPN if the strcspn() function is not available.
X */
X
X/* #define STRCSPN 	/* */
X
X/*
X *	Define NO_SIGINTERRUPT on BSD based systems which don't have
X *	a siginterrupt() function, but provides an SV_INTERRUPT flag
X *	in <signal.h>.
X */
X
X/* #define NO_SIGINTERRUPT	/* */
X
X
X#ifdef NETWORK_DATABASE
X
X/*
X *	Define NETWORK_BYTE_ORDER if the machine's int32's are
X *	already in network byte order, i.e. m68k based.
X */
X
X#undef NETWORK_BYTE_ORDER	/* */
X
XYOU LOSE -- I DON'T KNOW HOW TO DO THIS ON XENIX 386
X
X/*
X *	OTHERWISE provide the functions/macros ntohl/htonl to
X *	convert longs from and to network byte order
X */
X
X/*
X * Include appropriate files or define macroes or functions (include them 
X * in data.c) to convert longs and shorts to and from network byte order.
X */
X
X/*
X * This will work on most BSD based systems...
X */
X
X#include <netinet/in.h>
X
X/*
X * Otherwise, define something appropriate below
X */
X
X#define htonl(l)	...	/* host long to network long */
X#define ntohl(l)	...	/* network long to host long */
X
X#endif	/* NETWORK DATABASE */
NN_IS_BETTER
chmod 0644 m-xenix386.h || echo "restore of m-xenix386.h fails"
set `wc -c m-xenix386.h`;Sum=$1
if test "$Sum" != "1687"
then echo original size 1687, current size $Sum;fi
rm -f s2_seq_.tmp
echo "You have unpacked the last part"
exit 0

-- 
Kim F. Storm        storm@texas.dk        Tel +45 429 174 00
Texas Instruments, Marielundvej 46E, DK-2730 Herlev, Denmark
	  No news is good news, but nn is better!

aem@ibiza.cs.miami.edu (a.e.mossberg) (07/12/89)

storm@texas.dk (Kim F. Storm) writes:

>Once more the size of the patches has grown out of hands, and I have
>been forced to split the patches into a three-part shell archive.
>To apply the patches, you must unpack the three archives in turn
>into the nn sources directory using :unshar, and then run
>	patch < PATCH.4
>to apply the patches.

Using :unshar doesn't work in nn because of the following line:

>sed 's/^X//' << 'NN_IS_BETTER' > PATCH.4 &&
					  ^^^- kills unshar and causes a 
					       coredump

Also, the patches are on freja (129.142.96.1, I think) but are
named nn-patch3[abc] instead of nn-patch4[abc].


aem
a.e.mossberg - aem@mthvax.cs.miami.edu/aem@umiami.BITNET - Pahayokee Bioregion
If you crumple your money into little balls, it will never stick together.
							- David Byrne

wietse@wzv.win.tue.nl (Wietse Z. Venema) (07/12/89)

Kim F. Storm writes:

> This is patch #4 for nn 6.3 (part 1 of 3).

The patch is a great improvement with respect to portability to 16-bit
hardware.  It eliminates most 16/32 bit conflicts, and introduces a new
one.  The following three modifications should help us 16-bit folks out.

*** ./sequence.c-	Tue Jul 11 21:38:23 1989
--- ./sequence.c	Tue Jul 11 22:13:10 1989
***************
*** 363,369 ****
  
  static faked_entry(name, flag)
  char *name;
! int flag;
  {
      group_header *gh;
      
--- 363,369 ----
  
  static faked_entry(name, flag)
  char *name;
! int32 flag;
  {
      group_header *gh;
      
*** ./rc.c-	Tue Jul 11 21:38:16 1989
--- ./rc.c	Tue Jul 11 22:13:09 1989
***************
*** 443,449 ****
  	gh->group_flag &= ~G_UNREAD_COUNT;
      }    
  	
!     return was_unread;
  }
  
  
--- 443,449 ----
  	gh->group_flag &= ~G_UNREAD_COUNT;
      }    
  	
!     return (was_unread != 0);
  }
  
  
*** ./articles.c-	Tue Jul 11 21:36:58 1989
--- ./articles.c	Tue Jul 11 22:36:27 1989
***************
*** 225,231 ****
  	    max_articles += NEXT_ART_ARRAY_SIZE;
  	}
  	art_array = (article_header **)
! 	    calloc(max_articles, sizeof(article_header **));
  	mem_check((char *)art_array, (int)max_articles, "article headers");
  	while (--n >= 0) art_array[n] = *--articles;
  	articles = art_array + mem_offset;
--- 225,231 ----
  	    max_articles += NEXT_ART_ARRAY_SIZE;
  	}
  	art_array = (article_header **)
! 	    calloc((unsigned)max_articles, sizeof(article_header **));
  	mem_check((char *)art_array, (int)max_articles, "article headers");
  	while (--n >= 0) art_array[n] = *--articles;
  	articles = art_array + mem_offset;

seindal@skinfaxe.diku.dk (Rene' Seindal) (07/13/89)

aem@ibiza.cs.miami.edu (a.e.mossberg) writes:

> Also, the patches are on freja (129.142.96.1, I think) but are
> named nn-patch3[abc] instead of nn-patch4[abc].

My fault.  It is fixed.  Sorry.

Rene' Seindal (seindal@diku.dk).