diff -c +recursive +new-file nn-6.4.16/account.c ann/account.c
*** nn-6.4.16/account.c	Fri Oct 12 22:44:00 1984
--- ann/account.c	Thu Mar 27 17:52:31 1985
***************
*** 40,45 ****
--- 40,49 ----
  #include "proto.h"
  #include <errno.h>
  
+ #ifdef	AMIGA
+ FILE	*debugfh;
+ #endif
+ 
  import char *db_directory;
  
  
***************
*** 382,387 ****
--- 386,395 ----
      char *fname;
      int users, i;
      struct account ac, *actab;
+ 
+ #ifdef	AMIGA
+ 	debugfh=fopen("*","w");
+ #endif
      
      who_am_i = I_AM_ACCT;
  
diff -c +recursive +new-file nn-6.4.16/admin.c ann/admin.c
*** nn-6.4.16/admin.c	Fri Oct 12 22:44:00 1984
--- ann/admin.c	Thu Mar 27 17:54:15 1985
***************
*** 11,16 ****
--- 11,20 ----
  #include "proto.h"
  #include "term.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  import char
      *master_directory, *db_directory, *db_data_directory,
      *bin_directory, *news_directory, *news_lib_directory,
***************
*** 168,178 ****
--- 172,194 ----
  	    return;
  	}
  	if (db_data_subdirs)
+ #ifdef	AMIGA
+ 	    sprintf(command, "cd %s ; list [0-9] | %s", db_data_directory, pager);
+ #else
  	    sprintf(command, "cd %s ; ls -l [0-9] | %s", db_data_directory, pager);
+ #endif
  	else
+ #ifdef	AMIGA
+ 	sprintf(command, "list %s | %s", db_data_directory, pager);
+ #else
  	sprintf(command, "ls -l %s | %s", db_data_directory, pager);
+ #endif
      } else
+ #ifdef	AMIGA
+ 	sprintf(command, "list %s", db_data_path(name, gh, '*'));
+ #else
  	sprintf(command, "ls -l %s", db_data_path(name, gh, '*'));
+ #endif
      system(command);
  }
  
***************
*** 310,315 ****
--- 326,332 ----
  	goto err;
      }
  #endif
+ 
  
      ix = open_data_file(gh, 'x', OPEN_READ);
      if (ix == NULL) valerr(("NO INDEX FILE"), 1);
diff -c +recursive +new-file nn-6.4.16/amiga-aux.c ann/amiga-aux.c
*** nn-6.4.16/amiga-aux.c
--- ann/amiga-aux.c	Wed Mar 26 11:08:47 1985
***************
*** 0 ****
--- 1,208 ----
+ /*
+ 	Aux script for the Amiga
+ 
+ 	by Alexander Rawass, a_rawass@informatik.uni-kl.de
+ */
+ 
+ #include <stdio.h>
+ #include <exec/types.h>
+ 
+ #include "readconfig.h"
+ 
+ #define STREQU(x,y) (!(strcmp(x,y)))
+ #define STRNEQU(x,y,z) (!(strncmp(x,y,z)))
+ 
+ #define	INVOKED	argv[0]
+ #define	INVOKE_PATH	argv[1]
+ #define	COMMAND	argv[2]
+ #define	TEMPFILE	argv[3]
+ #define	ARTID	argv[4]
+ #define	GROUPNAME	argv[5]
+ 
+ #define	LAST_ARTICLE	"t:last.article"
+ 
+ #define	LMAX 200
+ 
+ int	main(argc,argv)
+ int	argc;
+ STRPTR	argv[];
+ {
+ 	char	combuf[100];
+ 	char	ans[10];
+ 	char	ans2[10];
+ 	int		st;
+ 	char	buf[LMAX];
+ 	FILE	*tfh;
+ 	FILE	*sfh;
+ 	int		i;
+ 	FILE	*fh;
+ 	struct	uuconfig	conf;
+ 
+ 	if(!STREQU(INVOKED,"amiga-aux")){
+ 		printf("not invoked as nnaux, invoked as %s\n",INVOKED);
+ 		exit(1);
+ 	}
+ 	
+ 	if(readconfig("uulib:config",&conf)==FALSE
+ 		|| readconfig("uulib:.nnrc",&conf)==FALSE){
+ 		printf("ERROR: uulib:config and/or uulib:.nnrc not found\n");
+ 		sleep(3);
+ 		exit(9);		
+ 	}
+ 
+ 	if(STREQU(COMMAND,"post") || STREQU(COMMAND,"follow")){
+ 		sprintf(combuf,"%s %s",conf.Editor,TEMPFILE);
+ 		system(combuf);
+ 		
+ 		do{
+ /*			printf("\na)bort e)dit h)old m)ail r)eedit s)end v)iew w)rite\n");	*/
+ 			printf("\na)bort e)dit m)ail s)end v)iew p)ost\n");
+ 			printf("Action: (post article) ");	fflush(stdout);
+ 			scanf("%s",&ans);
+ 			
+ 			switch(ans[0]){
+ 				case 'a':
+ 				printf("\nConfirm abort: (y) ");	fflush(stdout);
+ 				scanf("%s",&ans2);
+ 				if(ans2[0]=='y'){
+ 					unlink(LAST_ARTICLE);
+ 					rename(TEMPFILE,LAST_ARTICLE);
+ 					exit(22);
+ 				}
+ 				break;
+ 				case 'e':
+ 				sprintf(combuf,"%s %s",conf.Editor,TEMPFILE);
+ 				system(combuf);
+ 				break;
+ 				case 'm':
+ 				/* mailer */
+ 				break;
+ 				case 'v':
+ 				sprintf(combuf,"more %s",TEMPFILE);
+ 				system(combuf);
+ 				break;
+ 				/*			case '\n':	*/
+ 				case 'p':
+ 				case 's':
+ 				sprintf(combuf,"%s %s",conf.NewsCommand,TEMPFILE);
+ 				st=system(combuf);
+ 				if(st==0){
+ 					printf("Be patient! Your new article will not show up immediately.\n");
+ 				}
+ 				else{
+ 					printf("Posting not sent!\n");
+ 				}
+ 				sleep(2);
+ 				unlink(LAST_ARTICLE);
+ 				rename(TEMPFILE,LAST_ARTICLE);
+ 				exit(st);
+ 				break;
+ 				default:
+ 				printf("command %c) not yet supported\n",ans[0]);
+ 				break;
+ 			}
+ 		}
+ 		while(TRUE);
+ 	}
+ 	else if(STREQU(COMMAND,"mail") || STREQU(COMMAND,"forward")
+ 	|| STREQU(COMMAND,"reply")){
+ 		sprintf(combuf,"%s %s",conf.Editor,TEMPFILE);
+ 		system(combuf);
+ 		
+ 		do{
+ /*			printf("\na)bort e)dit h)old m)ail r)eedit s)end v)iew w)rite\n");	*/
+ 			printf("\na)bort e)dit m)ail s)end v)iew\n");
+ 			printf("Action: (send letter) ");	fflush(stdout);
+ 			scanf("%s",&ans);
+ 			
+ 			switch(ans[0]){
+ 				case 'a':
+ 				printf("\nConfirm abort: (y) ");	fflush(stdout);
+ 				scanf("%s",&ans2);
+ 				if(ans2[0]=='y'){
+ 					unlink(LAST_ARTICLE);
+ 					rename(TEMPFILE,LAST_ARTICLE);
+ 					exit(22);
+ 				}
+ 				break;
+ 				case 'e':
+ 				sprintf(combuf,"%s %s",conf.Editor,TEMPFILE);
+ 				system(combuf);
+ 				break;
+ 				case 'm':
+ 				/* mailer */
+ 				break;
+ 				case 'v':
+ 				sprintf(combuf,"more %s",TEMPFILE);
+ 				system(combuf);
+ 				break;
+ 				case 's':
+ 				/* sendmail haengt keine signature an */
+ 				/* also tuen wir das */
+ 				
+ 				tfh=fopen(TEMPFILE,"a+");
+ 				sfh=fopen(conf.MailSignature,"r");
+ 				fgets(buf,LMAX,sfh);
+ 				while(!feof(sfh)){
+ 					fputs(buf,tfh);
+ 					fgets(buf,LMAX,sfh);
+ 				}
+ 				fclose(sfh);
+ 				
+ 				fclose(tfh);
+ 
+ 				sprintf(combuf,"%s %s",conf.MailCommand,TEMPFILE);
+ 				st=system(combuf);
+ 				if(st==0){
+ 					printf("Mail sent!\n");
+ 				}
+ 				else{
+ 					printf("Mailer failed!\n");
+ 				}
+ 				sleep(2);
+ 				unlink(LAST_ARTICLE);
+ 				rename(TEMPFILE,LAST_ARTICLE);
+ 				exit(st);
+ 				break;
+ 				default:
+ 				printf("command %c) not yet supported\n",ans[0]);
+ 				break;
+ 			}
+ 		}
+ 		while(TRUE);
+ 	}
+ 	else if(STREQU(COMMAND,"cancel")){
+ 		fh=fopen(TEMPFILE,"w");
+ 		if(fh==NULL){
+ 			printf("cannot open %s\n",TEMPFILE);
+ 			exit(78);
+ 		}
+ 		fprintf(fh,"Newsgroups: %s\n",GROUPNAME);
+ 		fprintf(fh,"Subject: cancel <%s>\n",ARTID);
+ 		fprintf(fh,"Control: cancel <%s>\n",ARTID);
+ 		fprintf(fh,"\n");
+ 		fprintf(fh,"cancel <%s> in newsgroup %s\n",ARTID,GROUPNAME);
+ 		fclose(fh);
+ 
+ 				sprintf(combuf,"%s %s",conf.NewsCommand,TEMPFILE);
+ 				st=system(combuf);
+ 				if(st==0){
+ 					printf("Article cancelled!\n");
+ 				}
+ 				else{
+ 					printf("Article not cancelled!\n");
+ 				}
+ 				sleep(2);
+ 				unlink(LAST_ARTICLE);
+ 				rename(TEMPFILE,LAST_ARTICLE);
+ 				exit(st);
+ 	}
+ 	else{
+ 		printf("command %s not understood\n",COMMAND);
+ 		for(i=0;i<argc;i++){
+ 			printf("%s\n",argv[i]);
+ 		}
+ 		sleep(10);
+ 		exit(1);
+ 	}
+ }
diff -c +recursive +new-file nn-6.4.16/answer.c ann/answer.c
*** nn-6.4.16/answer.c	Fri Oct 12 22:44:00 1984
--- ann/answer.c	Thu Mar 27 17:55:22 1985
***************
*** 11,16 ****
--- 11,25 ----
  #include "options.h"
  #include "regexp.h"
  
+ #ifdef AMIGA
+ #define	FALSE	0L
+ #include "readconfig.h"
+ #endif
+ 
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  extern char *temp_file;
  extern char *news_lib_directory;
  
***************
*** 336,341 ****
--- 345,351 ----
      extern char *nntp_get_filename();
  #endif
  
+ 
      if (strcmp(prog, "COMPLETE") == 0) goto no_params;
  
      param = open_file(relative(nn_directory, ".param"), OPEN_CREATE);
***************
*** 411,420 ****
--- 421,449 ----
      *ap++ = temp_file;
      *ap++ = NULL;
  
+ #ifdef AMIGA
+ {
+ char	myid[200];
+ 
+ if(strcmp(prog,"cancel")==0){
+ 	ap--;
+ 	strncpy(myid,action+1,strlen(action)-2);
+ 	*ap++ = myid;		/* id */
+ 	*ap++ = record;		/* group */
+ 	*ap++ = NULL;
+ }
+     if (execute("amiga-aux", args, 1)) {
+ 	sprintf(delayed_msg, sent_fmt, " not");
+ 	return 1;
+     }
+ }
+ #else
      if (execute(SHELL, args, 1)) {
  	sprintf(delayed_msg, sent_fmt, " not");
  	return 1;
      }
+ #endif
+ 
      sprintf(delayed_msg, sent_fmt, "");
      return 0;
  }
***************
*** 769,775 ****
--- 798,817 ----
      char hname[100], *un;
  
      if (inetname == NULL) {
+ #ifdef AMIGA
+ {
+ struct	uuconfig	conf;
+ 
+ 	if(readconfig("uulib:config",&conf)==FALSE){
+ 		gethostname(hname,100);	/* returns 'amiga' */
+ 	}
+ 	else{
+ 		sprintf(hname,"%s%s",&(conf.NodeName),&(conf.DomainName));
+ 	}
+ }
+ #else
  	gethostname(hname, 100);
+ #endif
  	un = user_name();
  	inetname = newstr(strlen(hname) + strlen(un) + 2);
  	sprintf(inetname, "%s@%s", un, hname);
diff -c +recursive +new-file nn-6.4.16/collect.c ann/collect.c
*** nn-6.4.16/collect.c	Fri Oct 12 22:44:00 1984
--- ann/collect.c	Thu Mar 27 17:56:20 1985
***************
*** 8,13 ****
--- 8,17 ----
  #include "db.h"
  #include "news.h"
  
+ #ifdef	AMIGA
+ extern FILE	*debugfh;
+ #endif
+ 
  #define COUNT_RE_REFERENCES	/* no of >>> depends on Reference: line */
  
  export int ignore_bad_articles = 1;	/* no Newsgroups: line */
***************
*** 318,323 ****
--- 322,328 ----
      long article_count, temp, obad;
      article_number start_collect;
  
+ 
      if (gh->last_db_article == 0) {
  	gh->first_db_article = gh->first_a_article;
  	gh->last_db_article = gh->first_db_article - 1;
***************
*** 415,420 ****
--- 420,426 ----
      int col_group_count;
      time_t start_time;
  
+ 
      start_time = cur_time();
      col_article_count = col_group_count = 0;
      current_group = NULL; /* for init_group */
***************
*** 426,433 ****
--- 432,441 ----
  	    break;
  	}
  
+ 
  	if (gh->master_flag & M_IGNORE_GROUP) continue;
  
+ 
  	if (gh->master_flag & M_MUST_CLEAN)
  	    clean_group(gh);
  
***************
*** 436,441 ****
--- 444,450 ----
  	    continue;
  	}
  
+ 
  	if (!init_group(gh)) {
  	    if ((gh->master_flag & M_NO_DIRECTORY) == 0) {
  		log_entry('R', "%s: no directory", gh->group_name);
***************
*** 448,458 ****
--- 457,469 ----
  	    continue;
  	}
  
+ 
  	if (gh->master_flag & M_NO_DIRECTORY) {
  	    /* The directory has been created now */
  	    gh->master_flag &= ~M_NO_DIRECTORY;
  	    clean_group(gh);
  	}
+ 
  
  	temp = collect_group(gh);
  #ifdef NNTP
diff -c +recursive +new-file nn-6.4.16/conf/s-amiga.h ann/conf/s-amiga.h
*** nn-6.4.16/conf/s-amiga.h
--- ann/conf/s-amiga.h	Fri Mar 28 10:04:39 1985
***************
*** 0 ****
--- 1,143 ----
+ /* system file for AMIGA */
+ 
+ #define	AMIGA
+ 
+ /*
+  *	System V based system
+  *	TERMCAP is used instead of TERMINFO
+  */
+ 
+ /*
+  *	This is a generic System V Release 2 & 3 file.
+  *
+  *	If you need to modify anything, make a new s- file,
+  *	#include this file, and #define or #undef a few symbols.
+  */
+ 
+ 
+ /*
+  *	Include header files containing the following definitions:
+  *
+  * 		off_t, time_t, struct stat
+  */
+ 
+ #ifdef lint
+ struct proc {	/* sys/types.h references this on many systems */
+     int keep_lint_happy;
+ };
+ #endif
+ 
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ 
+ /*
+  *	Define if your system has system V like ioctls
+  */
+ 
+ /* #define	HAVE_TERMIO */			/* */
+ 
+ /*
+  *	Define to use terminfo database.
+  *	Otherwise, termcap is used
+  */
+ 
+ #define	USE_TERMINFO			/* */
+ 
+ /*
+  *	Specify the library containing the termcap/terminfo access routines.
+  *	Notice:  nn does not use curses.
+  *	Notice:  You must also specify whether termcap or terminfo is
+  *		 used when you edit config.h (see below).
+  */
+ 
+ #define	TERMLIB -lcurses
+ 
+ /*
+  *	Define HAVE_STRCHR if strchr() and strrchr() are available
+  */
+ 
+ #define HAVE_STRCHR			/* */
+ 
+ /*
+  *	Define if a signal handler has type void (see signal.h)
+  */
+ 
+ #define	SIGNAL_HANDLERS_ARE_VOID	/* */
+ 
+ /*
+  *	Define if signals must be set again after they are caught
+  */
+ 
+ #define	RESET_SIGNAL_WHEN_CAUGHT	/* */
+ 
+ /*
+  *	Define if your system has BSD like job control (SIGTSTP works)
+  */
+ 
+ /* #define HAVE_JOBCONTROL			/* */
+ 
+ /*
+  *	Define if your system provides the "directory(3X)" access routines
+  *
+  *	If true, include the header file(s) required by the package below
+  *	(remember that <sys/types.h> or equivalent is included above)
+  *	Also typedef Direntry to the proper struct type.
+  */
+ 
+ #ifdef NO_DIRENT_H
+ #undef NO_DIRENT_H
+ #else
+ 
+ #define	HAVE_DIRECTORY			/* */
+ 
+ #include <dirent.h>			/* System V */
+ typedef struct dirent Direntry;		/* System V */
+ 
+ #endif
+ 
+ /*
+  *	Define if your system has a mkdir() library routine
+  */
+ 
+ #define	HAVE_MKDIR			/* */
+ 
+ /*
+  *	Define HAVE_GETHOSTNAME if your system provides a BSD like
+  *	gethostname routine.
+  *	Otherwise, define HAVE_UNAME if uname() is avaiable.
+  *	As a final resort, define HOSTNAME to the name of your system.
+  */
+ 
+ #define	HAVE_GETHOSTNAME			/* System V */
+ 
+ /*
+  *	Define DETATCH_TERMINAL to be a command sequence which
+  *	will detatch a process from the control terminal
+  *	Also include files needed to perform this HERE.
+  *	If not possible, just define it (empty)
+  */
+ 
+ #define	DETATCH_TERMINAL setpgrp();	/* System V */
+ 
+ /*
+  *	Specify where the Bourne Shell is.
+  */
+ 
+ #define SHELL		"/bin/sh"
+ 
+ /*
+  *	Specify the default mailer to be invoked by nnmail
+  */
+ 
+ #define	MAILX		"/usr/bin/rmail"	/* SV */
+ 
+ /*
+  *	Define the maximum length of any pathname that may occur
+  */
+ 
+ #define	FILENAME 	256
+ 
+ #undef USE_TERMINFO
+ #undef TERMLIB
+ 
+ #define TERMLIB -ltermlib
diff -c +recursive +new-file nn-6.4.16/config.h ann/config.h
*** nn-6.4.16/config.h	Wed Feb 06 06:27:00 1985
--- ann/config.h
***************
*** 1,381 ****
- /**************************** NN CONFIGURATION ***************************
-  *
-  *	Configuration file for nn.
-  *
-  *	You must edit this file to reflect your local configuration
-  *	and environment.
-  *
-  *	Before editing this file, read the licence terms in the README
-  *	file and the installation guidelines in the INSTALLATION file.
-  *
-  *	(c) Copyright 1990, Kim F. Storm.  All rights reserved.
-  */
- 
- #define	RELEASE 	"6.4"
- 
- #include <stdio.h>
- #include <ctype.h>
- 
- 
- /*********************** NETWORK DEPENDENT DEFINITIONS **********************
-  *
- Y *	Define NETWORK_DATABASE if you share the database through NFS on
-  *	a network with different, non-compatible machines, e.g. SUNs and
-  *	VAXen, or SUN-3 and SUN-4, or if you are using different compilers
-  *	on the same architecture.
-  *
-  *	In a homogenous network, you can leave it undefined for higher
-  *	performance (no data conversion is needed).
-  */
- 
- /* #define NETWORK_DATABASE	/* */
- 
- 
- /********************************** NNTP *********************************
-  *
-  * 	Define NNTP to enable nntp support.  If you are not using NNTP,
-  *	just leave the following NNTP_* definitions as they are - they
-  *	will be ignored anyway.
-  *
-  *	With NNTP, the nnmaster still maintains a local database of
-  *	all article headers for fast access (and because NNTP does not
-  *	support nn - yet), while the articles are fetched from the
-  *	nntp server when they are read or saved.
-  *
-  *	You may still share this database through NFS locally (see the
-  *	description of NETWORK_DATABASE above) if you don't want to
-  *	have separate nn databases on all your local systems.
-  *
-  *	Consult the file NNTP for further information on the use of NNTP.
-  */
- 
- /* #define NNTP			/* */
- 
- /*
-  *	Define NNTP_SERVER to the name of a file containing the name of the
-  *	nntp server.
-  *
-  *	It is vital that both the nnmaster and all nn users on a machine
-  *	uses the same nntp server, because the nn database is synchronized
-  *	with a specific news active file.
-  *
-  *	If the file name does not start with a slash, it is relative to
-  *	LIB_DIRECTORY defined below.
-  *	NOTE: If you plan to use the included inews, it MUST be a full pathname
-  */
- 
- /* #define NNTP_SERVER	"/usr/local/lib/news/nntp/nntp_server"
- 
- /*
-  *	Define NNTP_POST if you want nn to reject attempts to post via
-  *	NNTP to a server, that disallows postings.
-  *
-  *	You should define this, if you use the NNTP based mini-inews for
-  *	postings from NNTP clients.  If you use another mechanism, that
-  *	does not involve NNTP, you should leave it undefined.
-  */
- 
- /* #define NNTP_POST             /* */
- 
- /*
-  *	NNTP's mini-inews seems to require that messages contain a complete
-  *	header with Message-ID, Path, and Date fields which the normal inews
-  *	generates itself.  If your mini-inews requires these headers to
-  *	be present, define NNTP_MINI_INEWS_HEADER below.
-  */
- 
- /* #define NNTP_MINI_INEWS_HEADER	/* uses "broken" mini-inews */
- 
- 
- /***************** OPERATING SYSTEM DEPENDENT DEFINITIONS *******************
-  *
-  *  	Include the appropriate s- file for your system below.
-  *
-  *	If a file does not exist for your system, you can use
-  *	conf/s-template.h as a starting point for writing you own.
-  */
- 
- #include "s-sys5-tcap.h"				/* 4.2 BSD and Ultrix */
- 
- /*
-  *	Define DEFAULT_PAGER as the initial value of the 'pager' variable.
-  *	nnadmin pipes shell command output though this command.
-  */
- 
- #define DEFAULT_PAGER	"less"	/* system V */
- /* #define DEFAULT_PAGER		"more"		/* bsd */
- 
- /*
-  *	DEFAULT_PRINTER is the initial value of the 'printer' variable.
-  *	nn's :print command pipes text into this command.
-  */
- 
- /* #define DEFAULT_PRINTER	"lp -s"		/* System V */
- #define DEFAULT_PRINTER		"lpr -h"	/* bsd */
- 
- /*
-  * 	Define RESIZING to make nn understand dynamic window-resizing.
-  * 	(It uses the TIOCGWINSZ ioctl found on most 4.3BSD systems)
-  */
- 
- #define RESIZING		/* */
- 
- 
- /********************** MACHINE DEPENDENT DEFINITIONS **********************
-  *
-  *	Include the appropriate m- file for your system below.
-  *
-  *	If a file does not exist for your system, you can use
-  *	conf/m-template.h as a starting point for writing you own.
-  */
- 
- #include "m-i80386.h"
- 
- 
- /***************************** OWNERSHIP ***************************
-  *
-  *	Specify owner and group for installed files and programs.
-  *
-  *	The nnmaster will run suid/sgid to this owner and group.
-  *
-  *	The only requirements are that the ownership allows the
-  *	nnmaster to READ the news related files and directories, and
-  *	the ordinary users to read the database and execute the nn*
-  *	programs.
-  *
-  *	Common choices are:  (news, news)  and   (your uid, your gid)
-  */
- 
- #define OWNER	"news"
- #define	GROUP	"news"
- 
- 
- /**************************** LOCALIZATION ****************************
-  *
-  *	Specify where programs and files are installed.
-  *
-  *	BIN_DIRECTORY    - the location of the user programs (mandatory)
-  *
-  *	LIB_DIRECTORY	 - the location of auxiliary programs and files.
-  *			   (mandatory UNLESS ALL of the following are defined).
-  *
-  *	MASTER_DIRECTORY - the location of the master program (on server)
-  *			   (= LIB_DIRECTORY if undefined)
-  *
-  *	CLIENT_DIRECTORY - the location of auxiliary programs (on clients)
-  *			   (= LIB_DIRECTORY if undefined)
-  *
-  *	HELP_DIRECTORY   - the location of help files, online manual, etc.
-  *			   (= CLIENT_DIRECTORY/help if undefined)
-  *
-  *	CACHE_DIRECTORY	 - if NNTP is used, nn uses this central directory
-  *			   to store working copies of articles on the local
-  *			   system.  If not defined, it stores the articles
-  *			   in each user's ~/.nn directory.
-  *
-  *	TMP_DIRECTORY    - temporary file storage.  Overriden by $TMPDIR.
-  *			   (= /usr/tmp if undefined).
-  *
-  *	LOG_FILE         - the location of nn's log file.
-  *			   (= LIB_DIRECTORY/Log if undefined).
-  */
- 
- #define BIN_DIRECTORY	"/usr/local/bin"
- #define LIB_DIRECTORY	"/usr/local/lib/nn"
- 
- 
- /**************************** DATABASE LOCATION **************************
-  *
-  *	Specify where the nn database should be installed.
-  *
-  *	If none of the following symbols are defined, the database will
-  *	be contained in the NEWS_DIRECTORY in a separate .nn directory for
-  *	master files and in files named .nnx and .nnd in each group's
-  *	spool directory.  To use this scheme, the OWNER specified above
-  *	must have write permission on the news spool directories.
-  *
-  *	If you access news via NNTP, you will probably always have to
-  *	give the database directory explicitly through DB_DIRECTORY
-  *	(and DB_DATA_DIRECTORY), since the normal news spool directories 
-  *	are probably not available on the local system.
-  *	The exception may be if nnmaster runs directly on the nntp server.
-  -
-  *
-  *	To change the default behaviour, you can define the following
-  *	symbols:
-  *
-  *	DB_DIRECTORY	   - the directory containing the master files.
-  *
-  *	DB_DATA_DIRECTORY  - the directory containing the per-group files
-  *			     (default is DB_DIRECTORY/DATA if undefined).
-  *
-  *	DB_LONG_NAMES	   - use group's name rather than number when
-  *			     building file names in DB_DATA_DIRECTORY.
-  *	     (The file system must support long file names!!)
-  */
- 
- /* #define DB_DIRECTORY	"/usr/spool/nn-6.4" */
- #define DB_DIRECTORY	"/usr/spool/news/.nn"
- 
- 
- /*************************** NEWS TRANSPORT **************************
-  *
-  *	Specify the location of your news programs and files
-  *	You only need to specify these if you are not
-  *	satisfied with the default settings.
-  *
-  *	NEWS_DIRECTORY	 	- The news spool directory.
-  *				  Default: /usr/spool/news
-  *
-  *	NEWS_LIB_DIRECTORY	- The news lib directory.
-  *				  Default: /usr/lib/news
-  *
-  *	INEWS_PATH		- The location of the inews program.
-  *				  Default: NEWS_LIB_DIR/inews
-  *
-  *	RMGROUP_PATH		- The location of the rmgroup program.
-  *				  Default: NEWS_LIB_DIR/{rm,del}group
-  */
- 
- #define NEWS_DIRECTORY		"/usr/spool/news"	/* */
- #define NEWS_LIB_DIRECTORY	"/usr/lib/news"	/* */
- 
- /* #define INEWS_PATH		"/usr/lib/news/inews"	/* */
- 
- 
- /*************************** MAIL INTERFACE *************************
-  *
-  *	Specify a mailer that accepts a letter WITH a header IN THE TEXT.
-  *
-  * 	A program named 'recmail' program is normally delivered with
-  *	the Bnews system, or you can use sendmail -t if you have it.
-  *
-  *	The contrib/ directory contains two programs which you might
-  *	be able to use with a little tweaking.
-  */
- 
- /* #define REC_MAIL	"/usr/lib/news/recmail"	/* non-sendmail */
- #define REC_MAIL	"/usr/bin/smail"	/* sendmail */
- 
- 
- /*
-  *	Define HAVE_ROUTING if your mailer understands domain based
-  *	adresses (...@...) and performs the necessary rerouting (e.g.
-  *	Sendmail or Smail).
-  *
-  *	Otherwise, nn will provide a simple routing facility using
-  *      routing information specified in the file LIB_DIRECTORY/routes.
-  */
- 
- #define HAVE_ROUTING			/* */
- 
- /*
-  *	If HAVE_ROUTING is NOT defined, nn needs to know the name of
-  * 	your host.  To obtain the host name it will use either of the
-  *	'uname' or 'gethostname' system calls as specified in the s-
-  *	file included above.
-  *
-  *	If neither 'uname' nor 'gethostname' is available, you must
-  *	define HOSTNAME to be the name of your host.  Otherwise, leave
-  *	it undefined (it will not be used anyway).
-  */
- 
- /* #define HOSTNAME	"myhost"	/* Not used if HAVE_ROUTING */
- 
- /*
-  *	Define APPEND_SIGNATURE if you want nn to ask users to append
-  *	~/.signature to mail messages (reply/forward/mail).
-  *
-  *	If the mailer defined in REC_MAIL automatically includes .signature
-  *	you should not define this (it will fool people to include it twice).
-  *
-  *	I think 'recmail' includes .signature, but 'sendmail -t' doesn't.
-  */
- 
- #define APPEND_SIGNATURE		/* */
- 
- /*
-  *	BUG_REPORT_ADDRESS is the initial value of the bug-report-address
-  *	variable which is used by the :bug command to report bugs in
-  *	the nn software.
-  */
- 
- #define BUG_REPORT_ADDRESS	"news"
- 
- 
- /*************************** DOCUMENTATION ***************************
-  *
-  * 	Specify directories for the user and system manuals
-  *
-  * 	Adapt this to your local standards; the manuals will be named
-  * 		$(MAN_DIR)/program.$(MAN_SECTION)
-  *
-  *	USER_MAN	- nn, nntidy, nngrep, etc.
-  *	SYS_MAN		- nnadmin
-  *	DAEMON_MAN	- nnmaster
-  */
- 
- #define USER_MAN_DIR 	"/usr/local/man/man1"
- #define USER_MAN_SECTION 	"1"
- 
- #define SYS_MAN_DIR 	"/usr/local/man/man1"
- #define SYS_MAN_SECTION 	"1m"
- 
- #define DAEMON_MAN_DIR 	"/usr/local/man/man8"
- #define DAEMON_MAN_SECTION 	"8"
- 
- 
- /************************** LOCAL POLICY *****************************
-  *
-  *	Define STATISTICS if you want to keep a record of how much
-  *	time the users spend on news reading.
-  *
-  *	Sessions shorter than the specified number of minutes are not
-  *	recorded (don't clutter up the log file).
-  *
-  *	Usage statistics is entered into the $LOG_FILE with code U
-  */
- 
- /* #define STATISTICS	5 /* minutes */
- 
- /*
-  *	Define ACCOUNTING if you want to keep accumulated accounting
-  *	based on the statistics in a separate 'acct' file.  In this
-  *	case, the accounting figures will be secret, and not be
-  *	written to the Log file.  And the users will not be able to
-  *	"decrease" their own account.
-  *
-  *	See account.c for optional cost calculation parameters.
-  */
- 
- /* #define ACCOUNTING		/* */
- 
- /*
-  *	Define AUTHORIZE if you want to restrict the use of nn to
-  *	certain users or certain periods of the day.  Define both
-  *	this and ACCOUNTING if you want to impose a usage quota
-  *
-  *	See account.c for implementing various access policies.
-  */
- 
- /* #define AUTHORIZE	/* */
- 
- /*
-  *	Default folder directory
-  */
- 
- #define FOLDER_DIRECTORY	"~/News"
- 
- /*
-  *	Max length of authors name (in "edited" format).
-  *	Also size of "Name" field on the article menus.
-  *	You may want to increase this if your terminals are wider than
-  *	80 columns.
-  */
- 
- #define NAME_LENGTH 		16
- 
- 
- /************************ CONFIGURATION COMPLETED ************************/
- 
- #include "global.h"
--- 0 ----
diff -c +recursive +new-file nn-6.4.16/config.h-amiga ann/config.h-amiga
*** nn-6.4.16/config.h-amiga
--- ann/config.h-amiga	Fri Mar 28 10:03:08 1985
***************
*** 0 ****
--- 1,386 ----
+ /**************************** NN CONFIGURATION ***************************
+  *
+  *	Configuration file for nn.
+  *
+  *	You must edit this file to reflect your local configuration
+  *	and environment.
+  *
+  *	Before editing this file, read the licence terms in the README
+  *	file and the installation guidelines in the INSTALLATION file.
+  *
+  *	(c) Copyright 1990, Kim F. Storm.  All rights reserved.
+  */
+ 
+ /*
+ 	modified to work with the Amiga by Alexander Rawass
+ */
+ 
+ #define	RELEASE 	"6.4"
+ 
+ #include <stdio.h>
+ #include <ctype.h>
+ 
+ 
+ /*********************** NETWORK DEPENDENT DEFINITIONS **********************
+  *
+ Y *	Define NETWORK_DATABASE if you share the database through NFS on
+  *	a network with different, non-compatible machines, e.g. SUNs and
+  *	VAXen, or SUN-3 and SUN-4, or if you are using different compilers
+  *	on the same architecture.
+  *
+  *	In a homogenous network, you can leave it undefined for higher
+  *	performance (no data conversion is needed).
+  */
+ 
+ /* #define NETWORK_DATABASE	/* */
+ 
+ 
+ /********************************** NNTP *********************************
+  *
+  * 	Define NNTP to enable nntp support.  If you are not using NNTP,
+  *	just leave the following NNTP_* definitions as they are - they
+  *	will be ignored anyway.
+  *
+  *	With NNTP, the nnmaster still maintains a local database of
+  *	all article headers for fast access (and because NNTP does not
+  *	support nn - yet), while the articles are fetched from the
+  *	nntp server when they are read or saved.
+  *
+  *	You may still share this database through NFS locally (see the
+  *	description of NETWORK_DATABASE above) if you don't want to
+  *	have separate nn databases on all your local systems.
+  *
+  *	Consult the file NNTP for further information on the use of NNTP.
+  */
+ 
+ /* #define NNTP			/* */
+ 
+ /*
+  *	Define NNTP_SERVER to the name of a file containing the name of the
+  *	nntp server.
+  *
+  *	It is vital that both the nnmaster and all nn users on a machine
+  *	uses the same nntp server, because the nn database is synchronized
+  *	with a specific news active file.
+  *
+  *	If the file name does not start with a slash, it is relative to
+  *	LIB_DIRECTORY defined below.
+  *	NOTE: If you plan to use the included inews, it MUST be a full pathname
+  */
+ 
+ /* #define NNTP_SERVER	"/usr/local/lib/news/nntp/nntp_server"
+ 
+ /*
+  *	Define NNTP_POST if you want nn to reject attempts to post via
+  *	NNTP to a server, that disallows postings.
+  *
+  *	You should define this, if you use the NNTP based mini-inews for
+  *	postings from NNTP clients.  If you use another mechanism, that
+  *	does not involve NNTP, you should leave it undefined.
+  */
+ 
+ /* #define NNTP_POST             /* */
+ 
+ /*
+  *	NNTP's mini-inews seems to require that messages contain a complete
+  *	header with Message-ID, Path, and Date fields which the normal inews
+  *	generates itself.  If your mini-inews requires these headers to
+  *	be present, define NNTP_MINI_INEWS_HEADER below.
+  */
+ 
+ /* #define NNTP_MINI_INEWS_HEADER	/* uses "broken" mini-inews */
+ 
+ 
+ /***************** OPERATING SYSTEM DEPENDENT DEFINITIONS *******************
+  *
+  *  	Include the appropriate s- file for your system below.
+  *
+  *	If a file does not exist for your system, you can use
+  *	conf/s-template.h as a starting point for writing you own.
+  */
+ 
+ #include "s-amiga.h"				/* AMIGA */
+ 
+ /*
+  *	Define DEFAULT_PAGER as the initial value of the 'pager' variable.
+  *	nnadmin pipes shell command output though this command.
+  */
+ 
+ /* #define DEFAULT_PAGER	"less"	*/ /* system V */
+ #define DEFAULT_PAGER		"more"		/* bsd */
+ 
+ /*
+  *	DEFAULT_PRINTER is the initial value of the 'printer' variable.
+  *	nn's :print command pipes text into this command.
+  */
+ 
+ /* #define DEFAULT_PRINTER	"lp -s"		/* System V */
+ #define DEFAULT_PRINTER		"type >prt:"	/* bsd */
+ 
+ /*
+  * 	Define RESIZING to make nn understand dynamic window-resizing.
+  * 	(It uses the TIOCGWINSZ ioctl found on most 4.3BSD systems)
+  */
+ 
+ #define RESIZING		/* */
+ 
+ 
+ /********************** MACHINE DEPENDENT DEFINITIONS **********************
+  *
+  *	Include the appropriate m- file for your system below.
+  *
+  *	If a file does not exist for your system, you can use
+  *	conf/m-template.h as a starting point for writing you own.
+  */
+ 
+ #include "m-m680x0.h"
+ 
+ 
+ /***************************** OWNERSHIP ***************************
+  *
+  *	Specify owner and group for installed files and programs.
+  *
+  *	The nnmaster will run suid/sgid to this owner and group.
+  *
+  *	The only requirements are that the ownership allows the
+  *	nnmaster to READ the news related files and directories, and
+  *	the ordinary users to read the database and execute the nn*
+  *	programs.
+  *
+  *	Common choices are:  (news, news)  and   (your uid, your gid)
+  */
+ 
+ #define OWNER	"news"
+ #define	GROUP	"news"
+ 
+ 
+ /**************************** LOCALIZATION ****************************
+  *
+  *	Specify where programs and files are installed.
+  *
+  *	BIN_DIRECTORY    - the location of the user programs (mandatory)
+  *
+  *	LIB_DIRECTORY	 - the location of auxiliary programs and files.
+  *			   (mandatory UNLESS ALL of the following are defined).
+  *
+  *	MASTER_DIRECTORY - the location of the master program (on server)
+  *			   (= LIB_DIRECTORY if undefined)
+  *
+  *	CLIENT_DIRECTORY - the location of auxiliary programs (on clients)
+  *			   (= LIB_DIRECTORY if undefined)
+  *
+  *	HELP_DIRECTORY   - the location of help files, online manual, etc.
+  *			   (= CLIENT_DIRECTORY/help if undefined)
+  *
+  *	CACHE_DIRECTORY	 - if NNTP is used, nn uses this central directory
+  *			   to store working copies of articles on the local
+  *			   system.  If not defined, it stores the articles
+  *			   in each user's ~/.nn directory.
+  *
+  *	TMP_DIRECTORY    - temporary file storage.  Overriden by $TMPDIR.
+  *			   (= /usr/tmp if undefined).
+  *
+  *	LOG_FILE         - the location of nn's log file.
+  *			   (= LIB_DIRECTORY/Log if undefined).
+  */
+ 
+ #define BIN_DIRECTORY	"NN:nnlib"
+ #define LIB_DIRECTORY	"NN:nnlib"
+ 
+ 
+ /**************************** DATABASE LOCATION **************************
+  *
+  *	Specify where the nn database should be installed.
+  *
+  *	If none of the following symbols are defined, the database will
+  *	be contained in the NEWS_DIRECTORY in a separate .nn directory for
+  *	master files and in files named .nnx and .nnd in each group's
+  *	spool directory.  To use this scheme, the OWNER specified above
+  *	must have write permission on the news spool directories.
+  *
+  *	If you access news via NNTP, you will probably always have to
+  *	give the database directory explicitly through DB_DIRECTORY
+  *	(and DB_DATA_DIRECTORY), since the normal news spool directories 
+  *	are probably not available on the local system.
+  *	The exception may be if nnmaster runs directly on the nntp server.
+  -
+  *
+  *	To change the default behaviour, you can define the following
+  *	symbols:
+  *
+  *	DB_DIRECTORY	   - the directory containing the master files.
+  *
+  *	DB_DATA_DIRECTORY  - the directory containing the per-group files
+  *			     (default is DB_DIRECTORY/DATA if undefined).
+  *
+  *	DB_LONG_NAMES	   - use group's name rather than number when
+  *			     building file names in DB_DATA_DIRECTORY.
+  *	     (The file system must support long file names!!)
+  */
+ 
+ /* #define DB_DIRECTORY	"/usr/spool/nn-6.4" */
+ #define DB_DIRECTORY	"NN:nndbase"
+ 
+ 
+ /*************************** NEWS TRANSPORT **************************
+  *
+  *	Specify the location of your news programs and files
+  *	You only need to specify these if you are not
+  *	satisfied with the default settings.
+  *
+  *	NEWS_DIRECTORY	 	- The news spool directory.
+  *				  Default: /usr/spool/news
+  *
+  *	NEWS_LIB_DIRECTORY	- The news lib directory.
+  *				  Default: /usr/lib/news
+  *
+  *	INEWS_PATH		- The location of the inews program.
+  *				  Default: NEWS_LIB_DIR/inews
+  *
+  *	RMGROUP_PATH		- The location of the rmgroup program.
+  *				  Default: NEWS_LIB_DIR/{rm,del}group
+  */
+ 
+ #define NEWS_DIRECTORY		"UUCP:news"	/* */
+ #define NEWS_LIB_DIRECTORY	"UUCP:lib/news"	/* */
+ 
+ #define INEWS_PATH		"relaynews"
+ 
+ 
+ /*************************** MAIL INTERFACE *************************
+  *
+  *	Specify a mailer that accepts a letter WITH a header IN THE TEXT.
+  *
+  * 	A program named 'recmail' program is normally delivered with
+  *	the Bnews system, or you can use sendmail -t if you have it.
+  *
+  *	The contrib/ directory contains two programs which you might
+  *	be able to use with a little tweaking.
+  */
+ 
+ /* #define REC_MAIL	"/usr/lib/news/recmail"	/* non-sendmail */
+ 
+ #define REC_MAIL	"sendmail"	/* sendmail */
+ 
+ 
+ /*
+  *	Define HAVE_ROUTING if your mailer understands domain based
+  *	adresses (...@...) and performs the necessary rerouting (e.g.
+  *	Sendmail or Smail).
+  *
+  *	Otherwise, nn will provide a simple routing facility using
+  *      routing information specified in the file LIB_DIRECTORY/routes.
+  */
+ 
+ #define HAVE_ROUTING			/* */
+ 
+ /*
+  *	If HAVE_ROUTING is NOT defined, nn needs to know the name of
+  * 	your host.  To obtain the host name it will use either of the
+  *	'uname' or 'gethostname' system calls as specified in the s-
+  *	file included above.
+  *
+  *	If neither 'uname' nor 'gethostname' is available, you must
+  *	define HOSTNAME to be the name of your host.  Otherwise, leave
+  *	it undefined (it will not be used anyway).
+  */
+ 
+ /* #define HOSTNAME	"myhost"	/* Not used if HAVE_ROUTING */
+ 
+ /*
+  *	Define APPEND_SIGNATURE if you want nn to ask users to append
+  *	~/.signature to mail messages (reply/forward/mail).
+  *
+  *	If the mailer defined in REC_MAIL automatically includes .signature
+  *	you should not define this (it will fool people to include it twice).
+  *
+  *	I think 'recmail' includes .signature, but 'sendmail -t' doesn't.
+  */
+ 
+ #define APPEND_SIGNATURE		/* */
+ 
+ /*
+  *	BUG_REPORT_ADDRESS is the initial value of the bug-report-address
+  *	variable which is used by the :bug command to report bugs in
+  *	the nn software.
+  */
+ 
+ #define BUG_REPORT_ADDRESS	"news"
+ 
+ 
+ /*************************** DOCUMENTATION ***************************
+  *
+  * 	Specify directories for the user and system manuals
+  *
+  * 	Adapt this to your local standards; the manuals will be named
+  * 		$(MAN_DIR)/program.$(MAN_SECTION)
+  *
+  *	USER_MAN	- nn, nntidy, nngrep, etc.
+  *	SYS_MAN		- nnadmin
+  *	DAEMON_MAN	- nnmaster
+  */
+ 
+ #define USER_MAN_DIR 	"usr:local/man/man1"
+ #define USER_MAN_SECTION 	"1"
+ 
+ #define SYS_MAN_DIR 	"usr:local/man/man1"
+ #define SYS_MAN_SECTION 	"1m"
+ 
+ #define DAEMON_MAN_DIR 	"usr:local/man/man8"
+ #define DAEMON_MAN_SECTION 	"8"
+ 
+ 
+ /************************** LOCAL POLICY *****************************
+  *
+  *	Define STATISTICS if you want to keep a record of how much
+  *	time the users spend on news reading.
+  *
+  *	Sessions shorter than the specified number of minutes are not
+  *	recorded (don't clutter up the log file).
+  *
+  *	Usage statistics is entered into the $LOG_FILE with code U
+  */
+ 
+ /* #define STATISTICS	5 /* minutes */
+ 
+ /*
+  *	Define ACCOUNTING if you want to keep accumulated accounting
+  *	based on the statistics in a separate 'acct' file.  In this
+  *	case, the accounting figures will be secret, and not be
+  *	written to the Log file.  And the users will not be able to
+  *	"decrease" their own account.
+  *
+  *	See account.c for optional cost calculation parameters.
+  */
+ 
+ /* #define ACCOUNTING		/* */
+ 
+ /*
+  *	Define AUTHORIZE if you want to restrict the use of nn to
+  *	certain users or certain periods of the day.  Define both
+  *	this and ACCOUNTING if you want to impose a usage quota
+  *
+  *	See account.c for implementing various access policies.
+  */
+ 
+ /* #define AUTHORIZE	/* */
+ 
+ /*
+  *	Default folder directory
+  */
+ 
+ #define FOLDER_DIRECTORY	"NNSAVE:"
+ 
+ /*
+  *	Max length of authors name (in "edited" format).
+  *	Also size of "Name" field on the article menus.
+  *	You may want to increase this if your terminals are wider than
+  *	80 columns.
+  */
+ 
+ #define NAME_LENGTH 		16
+ 
+ 
+ /************************ CONFIGURATION COMPLETED ************************/
+ 
+ #include "global.h"
diff -c +recursive +new-file nn-6.4.16/db.c ann/db.c
*** nn-6.4.16/db.c	Fri Oct 12 22:44:00 1984
--- ann/db.c	Thu Mar 27 17:58:03 1985
***************
*** 8,13 ****
--- 8,17 ----
  #include "db.h"
  #include <errno.h>
  
+ #ifdef	AMIGA
+ extern FILE	*debugfh;
+ #endif
+ 
  import char
      *master_directory, *db_directory, *db_data_directory, *news_directory;
  import int db_data_subdirs;
***************
*** 90,104 ****
  	    if (chdir(news_directory) < 0)
  		sys_error(news_directory);
  
! 	    if (chdir(group_path_name) < 0)
  		return 0;
  	}
  	group_file_name = group_path_name;
  	return 1;
      }
  
      /* client */
!     if (gh->master_flag & M_NO_DIRECTORY) return 0;
  
      if (check_group_access && !use_nntp) {
  	*p = NUL;
--- 94,111 ----
  	    if (chdir(news_directory) < 0)
  		sys_error(news_directory);
  
! 	    if (chdir(group_path_name) < 0){
  		return 0;
  	}
+ 	}
  	group_file_name = group_path_name;
  	return 1;
      }
  
      /* client */
!     if (gh->master_flag & M_NO_DIRECTORY) {
! 		return 0;
! 	}
  
      if (check_group_access && !use_nntp) {
  	*p = NUL;
***************
*** 466,471 ****
--- 473,480 ----
  #else
      Loop_Groups_Header(gh) {
  #endif
+ 
+ 
  	gh->group_num = l_g_index;
  	db_read_group(gh);
  	db_parse_group(gh, trust_master);
***************
*** 668,673 ****
--- 677,684 ----
  	    char *s;
  	    s = strrchr(data_file, '/');
  	    *s = NUL;
+ 
+ 
  	    if (!file_exist(data_file, "dx")) {
  		if (mkdir(data_file, 0755) < 0)
  		    sys_error("Cannot create directory %s", data_file);
***************
*** 858,863 ****
--- 869,875 ----
      buf[6] = gh->first_a_article;
      buf[7] = gh->last_a_article;
      buf[8] = gh->creation_time;
+ 
  
      host_to_net(buf, GROUP_FIELDS);
      if (fwrite((char *)buf, sizeof(net_long), GROUP_FIELDS, master_file) != GROUP_FIELDS)
diff -c +recursive +new-file nn-6.4.16/debug.c ann/debug.c
*** nn-6.4.16/debug.c
--- ann/debug.c	Wed Mar 05 10:22:17 1985
***************
*** 0 ****
--- 1,56 ----
+ #include <stdio.h>
+ 
+ extern	FILE	*debugfh;
+ 
+ FILE	*debug_fopen(name,arg)
+ char	*name;
+ char	*arg;
+ {
+ 
+ 
+ 	return(fopen(name,arg));
+ }
+ 
+ FILE	*debug_popen(name,arg)
+ char	*name;
+ char	*arg;
+ {
+ 
+ 
+ 	return(popen(name,arg));
+ }
+ 
+ int	debug_open(name,mode)
+ char	*name;
+ int	mode;
+ {
+ 
+ 
+ 	return(open(name,mode));
+ }
+ 
+ int	debug_stat(name,st)
+ char	*name;
+ struct	stat	*st;
+ {
+ 
+ 
+ 	return(stat(name,st));
+ }
+ 
+ int	debug_system(name)
+ char	*name;
+ {
+ 
+ 	fprintf(debugfh,"\033[1msystem(%s)\033[0m\n",name);
+ 
+ 	return(system(name));
+ }
+ 
+ void	debug_sys_error(str)
+ char	*str;
+ {
+ 
+ 	
+ 	return(sys_error(str));
+ }
diff -c +recursive +new-file nn-6.4.16/execute.c ann/execute.c
*** nn-6.4.16/execute.c	Fri Oct 12 22:44:00 1984
--- ann/execute.c	Fri Mar 28 11:03:27 1985
***************
*** 9,14 ****
--- 9,18 ----
  #include "config.h"
  #include "term.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  export int shell_restrictions = 0;	/* disable shell escapes */
  
  export char *init_shell = SHELL;
***************
*** 41,47 ****
--- 45,55 ----
  
      was_raw = toggle_visual ? visual_off() : unset_raw();
  
+ #ifdef	AMIGA
+ 	pid=0;
+ #else
      while ((pid = fork()) == -1) sleep(1);
+ #endif
  
      if (pid == 0) {
  	for (i = 3 ; i < 20 ; i++)
***************
*** 49,71 ****
  
  	if (exec_chdir_to != NULL) chdir(exec_chdir_to);
  
  	execv(path, args);
  
  	fprintf(stderr, "%s: not found\n", path);
  	nn_exit(20);
!     }
      quit = signal(SIGQUIT, SIG_IGN);
      intr = signal(SIGINT,  SIG_IGN);
  #ifdef HAVE_JOBCONTROL
      tstp = signal(SIGTSTP, SIG_DFL);
  #endif
      while ((i = wait(&status)) != pid && (i != -1 || errno == EINTR));
  
      signal(SIGQUIT, quit);
      signal(SIGINT,  intr);
  #ifdef HAVE_JOBCONTROL
      signal(SIGTSTP, tstp);
  #endif
      if (toggle_visual) {
  	visual_on();
  	if (toggle_visual == 2) s_redraw++;
--- 57,101 ----
  
  	if (exec_chdir_to != NULL) chdir(exec_chdir_to);
  
+ #ifdef	AMIGA
+ {
+ 	int	i;
+ 	char	combuf[200];
+ 
+ 	strcpy(combuf,path);
+ 	for(i=1;args[i]!=NULL;i++){
+ 		strcat(combuf," ");
+ 		strcat(combuf,args[i]);
+ 	}
+ 	
+ 	
+ 	status=system(combuf);
+ }
+ 	}	/* pid==0 */
+ #else
  	execv(path, args);
  
  	fprintf(stderr, "%s: not found\n", path);
  	nn_exit(20);
!     }	/* pid==0 */
! 
      quit = signal(SIGQUIT, SIG_IGN);
      intr = signal(SIGINT,  SIG_IGN);
  #ifdef HAVE_JOBCONTROL
      tstp = signal(SIGTSTP, SIG_DFL);
  #endif
+ 
      while ((i = wait(&status)) != pid && (i != -1 || errno == EINTR));
  
+ #endif	/* AMIGA */
+ 
      signal(SIGQUIT, quit);
      signal(SIGINT,  intr);
  #ifdef HAVE_JOBCONTROL
      signal(SIGTSTP, tstp);
  #endif
+ 
+ 
      if (toggle_visual) {
  	visual_on();
  	if (toggle_visual == 2) s_redraw++;
***************
*** 72,79 ****
      }
  
      if (was_raw) raw();
! 
      return (status & 0xff) ? 0x100 : (status >> 8);
  }
  
  
--- 102,113 ----
      }
  
      if (was_raw) raw();
!     
! #ifdef AMIGA
! 	return status;
! #else
      return (status & 0xff) ? 0x100 : (status >> 8);
+ #endif
  }
  
  
diff -c +recursive +new-file nn-6.4.16/expire.c ann/expire.c
*** nn-6.4.16/expire.c	Fri Oct 12 22:44:00 1984
--- ann/expire.c	Thu Mar 27 18:01:10 1985
***************
*** 11,16 ****
--- 11,20 ----
  #include "db.h"
  #include "dir.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  import int trace, debug_mode;
  import int nntp_failed;
  
***************
*** 597,602 ****
--- 601,607 ----
  	log_entry('X', "Expire: %ld art, %d gr, %ld s",
  		  exp_article_count, exp_group_count,
  		  (long)(cur_time() - start_time));
+ 
  
      return temp >= 0;
  }
diff -c +recursive +new-file nn-6.4.16/folder.c ann/folder.c
*** nn-6.4.16/folder.c	Fri Oct 12 22:44:00 1984
--- ann/folder.c	Fri Mar 07 19:14:38 1985
***************
*** 91,97 ****
--- 91,101 ----
  		if (folder_directory == NULL) {
  		    if (!(cp = getenv("FOLDER")))
  			cp = FOLDER_DIRECTORY;
+ #ifndef AMIGA
  		    folder_directory = home_relative(cp);
+ #else
+ 			folder_directory = cp;
+ #endif
  		}
  
  		cp = folder_directory;
***************
*** 105,111 ****
--- 109,119 ----
  
  	     cp_str:
  		while (*cp) *dp++ = *cp++;
+ #ifndef AMIGA
  		if (dp[-1] != '/') *dp++ = '/';
+ #else
+ 		if (dp[-1] != '/' && dp[-1] != ':' ) *dp++ = '/';
+ #endif
  		goto no_parse;
  	    }
  
diff -c +recursive +new-file nn-6.4.16/fullname.c ann/fullname.c
*** nn-6.4.16/fullname.c	Fri Oct 12 22:44:00 1984
--- ann/fullname.c	Wed Mar 05 10:03:03 1985
***************
*** 89,96 ****
  {
      static char *fullname = NULL;
      char inbuf[FILENAME];
      struct passwd *pw, *getpwuid();
! 
      if (fullname == NULL) {
  	if ((fullname = getenv("NAME")) != NULL)
  	    return fullname;
--- 89,99 ----
  {
      static char *fullname = NULL;
      char inbuf[FILENAME];
+ #ifdef AZTEC
+ 	struct passwd *pw;
+ #else
      struct passwd *pw, *getpwuid();
! #endif
      if (fullname == NULL) {
  	if ((fullname = getenv("NAME")) != NULL)
  	    return fullname;
diff -c +recursive +new-file nn-6.4.16/global.c ann/global.c
*** nn-6.4.16/global.c	Fri Oct 12 22:44:00 1984
--- ann/global.c	Thu Mar 27 18:03:38 1985
***************
*** 10,15 ****
--- 10,24 ----
  #include "config.h"
  #include "patchlevel.h"
  
+ #ifdef	AMIGA
+ #define	FALSE	0L
+ #include "readconfig.h"
+ #endif
+ 
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  export char *home_directory;
  export char *nn_directory;		/* ~/.nn */
  export char *news_directory;		/* /usr/spool/news */
***************
*** 33,39 ****
  export char *temp_file;
  
  #ifndef TMP_DIRECTORY
! #define TMP_DIRECTORY "/usr/tmp"
  #endif
  export char *tmp_directory = TMP_DIRECTORY;
  
--- 42,52 ----
  export char *temp_file;
  
  #ifndef TMP_DIRECTORY
! #ifdef AMIGA
! #define TMP_DIRECTORY "t:"
! #else
! #define TMP_DIRECTORY "/tmp"
! #endif /* AMIGA */
  #endif
  export char *tmp_directory = TMP_DIRECTORY;
  
***************
*** 229,234 ****
--- 242,249 ----
      db_data_directory = NULL;
  #endif
  #endif
+ 
+ 
  #ifndef DB_LONG_NAMES
      if (db_data_directory != NULL)
  	db_data_subdirs = file_exist(relative(db_data_directory, "0"), "dx");
***************
*** 270,277 ****
--- 285,297 ----
      signal(SIGTSTP, catch_suspend);
  #endif
  
+ #ifndef AMIGA
      if ((home_directory = getenv("HOME")) == NULL)
  	user_error("No HOME environment variable");
+ #else
+     if ((home_directory = getenv("HOME")) == NULL)
+ 	home_directory="NNHOME:";
+ #endif
  
      if ((pager = getenv("PAGER")) == NULL)
  	pager = DEFAULT_PAGER;
***************
*** 299,305 ****
--- 319,334 ----
  	else
  	    tmp_directory = temp_dir;
  
+ #ifdef	AMIGA
+ 	if(tmp_directory[strlen(tmp_directory)-1]==':'){
+ 	    sprintf(buf, "%snn.XXXXXX", tmp_directory);
+ 	}
+ 	else{
+ 	    sprintf(buf, "%s/nn.XXXXXX", tmp_directory);
+ 	}
+ #else
      sprintf(buf, "%s/nn.XXXXXX", tmp_directory);
+ #endif
      mktemp(buf);
      temp_file = buf;
  }
***************
*** 425,431 ****
--- 454,470 ----
  {
      static char concat_path[FILENAME];
  
+ #ifdef AMIGA
+ 	if(dir[strlen(dir)-1]==':'){
+ 		sprintf(concat_path,"%s%s",dir,name);
+ 	}
+ 	else{
+ 		sprintf(concat_path,"%s/%s",dir,name);
+ 	}
+ #else
      sprintf(concat_path, "%s/%s", dir, name);
+ #endif
+ 
      return concat_path;
  }
  
***************
*** 436,442 ****
--- 475,491 ----
      char *buf;
  
      buf = newstr(strlen(dir) + strlen(name) + 2);
+ 
+ #ifdef AMIGA
+ 	if(dir[strlen(dir)-1]==':'){
+ 		sprintf(buf,"%s%s",dir,name);
+ 	}
+ 	else{
+ 		sprintf(buf,"%s/%s",dir,name);
+ 	}
+ #else
      sprintf(buf, "%s/%s", dir, name);
+ #endif
  
      return buf;
  }
***************
*** 821,827 ****
--- 870,880 ----
  char *user_name()
  {
      static char *user = NULL;
+ #ifdef AZTEC
+ 	struct passwd *pw;
+ #else
      struct passwd *pw, *getpwuid();
+ #endif
      extern char *getlogin(), *getenv();
  
      if (who_am_i == I_AM_MASTER) return "M";
***************
*** 828,834 ****
--- 881,901 ----
      if (who_am_i == I_AM_EXPIRE) return "X";
  
      if (user == NULL) {
+ #ifdef	AMIGA
+ {
+ struct	uuconfig	conf;
+ 
+ 	if(readconfig("uulib:config",&conf)==FALSE){
+ 		user=getlogin();	/* returns 'amiga' */
+ 	}
+ 	else{
+ 		user=malloc(200);
+ 		strncpy(user,&(conf.UserName),200);
+ 	}
+ }
+ #else
  	user = getlogin();
+ #endif
  	if (user != NULL && *user != NUL) goto out;
  
  	pw = getpwuid((int)user_id);
diff -c +recursive +new-file nn-6.4.16/group.c ann/group.c
*** nn-6.4.16/group.c	Fri Oct 12 22:44:00 1984
--- ann/group.c	Thu Mar 27 18:05:13 1985
***************
*** 15,20 ****
--- 15,24 ----
  #include <syslog.h>
  #endif
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  export int  dont_split_digests = 0;
  export int  dont_sort_articles = 0;
  export int  also_cross_postings = 0;
***************
*** 468,474 ****
      
      mask = NULL;
      if (access_mode == 0) access_mode |= ACC_PARSE_VARIABLES;
!     
      if (command == K_GOTO_GROUP)
  	goto get_group_name;
  
--- 472,478 ----
      
      mask = NULL;
      if (access_mode == 0) access_mode |= ACC_PARSE_VARIABLES;
! 
      if (command == K_GOTO_GROUP)
  	goto get_group_name;
  
***************
*** 481,486 ****
--- 485,491 ----
  	if (gh == NULL)
  	    goto_return(ME_NO_REDRAW);
  
+ 
  	if (gh->first_db_article < gh->last_db_article && gh->current_first <= 0) {
  	    sprintf(buffer, "%s%s%s) ",
  		   (gh->group_flag & G_UNSUBSCRIBED) ? " UNSUB" : "",
***************
*** 784,792 ****
  
   more_articles:
      if (first > gh->last_db_article) goto_return(ME_NO_REDRAW);
- 
      if (gh != orig_group) goto enter_new_level;
- 
      if (!only_unread_articles && gh->current_first <= gh->first_db_article) {
  	msg("No extra articles");
  	goto_return(ME_NO_REDRAW);
--- 789,795 ----
***************
*** 917,923 ****
  
      Loop_Groups_Sequence(gh) {
  	if (gh->group_flag & G_FOLDER) continue;
! 	if (gh->master_flag & M_NO_DIRECTORY) continue;
  	if ((gh->group_flag & G_UNSUBSCRIBED) && !also_unsub_groups)
  	    continue;
  	if (!also_read_articles && gh->last_article >= gh->last_db_article)
--- 920,928 ----
  
      Loop_Groups_Sequence(gh) {
  	if (gh->group_flag & G_FOLDER) continue;
! 	if (gh->master_flag & M_NO_DIRECTORY) {
! 		continue;
! 	}
  	if ((gh->group_flag & G_UNSUBSCRIBED) && !also_unsub_groups)
  	    continue;
  	if (!also_read_articles && gh->last_article >= gh->last_db_article)
***************
*** 934,940 ****
  	    continue;
  	}
  
! 	if (gh->master_flag & M_NO_DIRECTORY) continue;
  	if ((gh->group_flag & G_UNSUBSCRIBED) && !also_unsub_groups)
  	    continue;
  
--- 939,947 ----
  	    continue;
  	}
  
! 	if (gh->master_flag & M_NO_DIRECTORY) {
! 		continue;
! 	}
  	if ((gh->group_flag & G_UNSUBSCRIBED) && !also_unsub_groups)
  	    continue;
  
***************
*** 1063,1069 ****
      if (amount < 0) {
  	Loop_Groups_Sequence(gh) {
  	    if (gh->group_flag & G_FAKED) continue;
! 	    if (gh->master_flag & M_NO_DIRECTORY) continue;
  	    if (gh != current_group) {
  		if (gh->unread_count <= 0) continue;
  		if (gh->group_flag & G_UNSUBSCRIBED && !also_unsub_groups)
--- 1070,1078 ----
      if (amount < 0) {
  	Loop_Groups_Sequence(gh) {
  	    if (gh->group_flag & G_FAKED) continue;
! 	    if (gh->master_flag & M_NO_DIRECTORY) {
! 			continue;
! 		}
  	    if (gh != current_group) {
  		if (gh->unread_count <= 0) continue;
  		if (gh->group_flag & G_UNSUBSCRIBED && !also_unsub_groups)
***************
*** 1073,1079 ****
  	}
      } else
      Loop_Groups_Sorted(gh) {
! 	if (gh->master_flag & (M_NO_DIRECTORY | M_IGNORE_GROUP)) continue;
  	if (amount <= 1 && gh->unread_count <= 0) continue;
  	if (amount == 0 && (gh->group_flag & G_UNSUBSCRIBED)) continue;
  	if (amount == 3 && (gh->group_flag & G_UNSUBSCRIBED) == 0) continue;
--- 1082,1090 ----
  	}
      } else
      Loop_Groups_Sorted(gh) {
! 	if (gh->master_flag & (M_NO_DIRECTORY | M_IGNORE_GROUP)){
! 		 continue;
! 	}
  	if (amount <= 1 && gh->unread_count <= 0) continue;
  	if (amount == 0 && (gh->group_flag & G_UNSUBSCRIBED)) continue;
  	if (amount == 3 && (gh->group_flag & G_UNSUBSCRIBED) == 0) continue;
diff -c +recursive +new-file nn-6.4.16/makefile.amiga ann/makefile.amiga
*** nn-6.4.16/makefile.amiga
--- ann/makefile.amiga	Fri Mar 28 10:02:45 1985
***************
*** 0 ****
--- 1,160 ----
+ CC =	 bin:gcc
+ CPP =	 bin:kcc -E
+ AMIGA_INCLUDE = -Iwork:src/aztec/include13
+ CFLAGS = -Iconf $(AMIGA_INCLUDE) -DAMIGA -DPATCH17 -DPATCH18
+ LDFLAGS = -s
+ BIN_PROG =	nn  nnusage nngrab nnstats nnacct
+ BIN_LINK =	nncheck nnadmin nntidy nngoback nngrep nnpost nnbatch
+ LIB_PROG =	aux upgrade_rc
+ MASTER_PROG =	nnmaster back_act nnspew
+ SHELL = /bin/sh
+ MASTER = master.o collect.o expire.o proto.o hostname.o \
+ 	global.o options.o active.o db.o nntp.o \
+ 	pack_date.o pack_name.o pack_subject.o news.o digest.o
+ NN = 	nn.o admin.o proto.o global.o options.o db.o nntp.o \
+ 	init.o variable.o term.o keymap.o macro.o regexp.o \
+ 	menu.o more.o newsrc.o group.o folder.o dir.o \
+ 	sort.o articles.o sequence.o kill.o active.o fullname.o \
+ 	answer.o reroute.o hostname.o save.o unshar.o decode.o execute.o \
+ 	pack_date.o pack_name.o pack_subject.o news.o digest.o match.o
+ ACCT = account.o global.o options.o proto.o hostname.o 
+ MAIL = nnmail.o reroute.o hostname.o global.o options.o
+ # all:	$(BIN_PROG) $(LIB_PROG) $(MASTER_PROG) inst
+ all: nn nnmaster simplenews amiga-aux
+ copyit: nn nnmaster simplenews amiga-aux
+ 	copy nn dh1:uucpplus/nnlib/nn
+ 	copy nnmaster dh1:uucpplus/nnlib/nnmaster
+ 	copy nn dh1:uucpplus/nnlib/nnadmin
+ 	copy amiga-aux dh1:uucpplus/nnlib/amiga-aux
+ 	copy simplenews dh1:uucpplus/nnlib/simplenews
+ 	copy amiga-back-act	dh1:uucpplus/nnlib/amiga-back-act
+ simplenews: simplenews.o readconfig.o
+ 	$(CC) -o simplenews simplenews.o readconfig.o $(CFLAGS) $(LDFLAGS)
+ simplenews.o: simplenews.c	readconfig.h readconfig.c
+ readconfig.o: readconfig.c readconfig.h
+ amiga-aux: amiga-aux.o readconfig.o
+ 	$(CC) -o amiga-aux amiga-aux.o readconfig.o $(CFLAGS) $(LDFLAGS)
+ amiga-aux.o: amiga-aux.c
+ # debug: debug.o
+ # debug.o: debug.c
+ client: $(BIN_PROG) $(LIB_PROG) inst
+ master: $(MASTER_PROG) inst
+ nn:	 $(NN) readconfig.o
+ 	echo "linking nn"
+ 	$(CC) -o nn $(NN) readconfig.o $(CFLAGS) $(LDFLAGS) gcc:c/heapmem.o -ltermcap -lamy -lc
+ nnmaster:  $(MASTER) readconfig.o
+ 	echo "linking nnmaster"
+ 	$(CC) -o nnmaster $(CFLAGS) $(MASTER) readconfig.o $(LDFLAGS) 
+ nnmail:	 $(MAIL)
+ 	echo "linking nnmail"
+ 	$(CC) -o nnmail $(CFLAGS) $(MAIL) $(LDFLAGS)
+ nnstats: nnstats.sh prefix
+ #	cat prefix nnstats.sh > nnstats ; chmod +x nnstats
+ nnusage: nnusage.sh prefix
+ #	cat prefix nnusage.sh > nnusage ; chmod +x nnusage
+ nngrab:	nngrab.sh prefix
+ #	cat prefix nngrab.sh > nngrab ; chmod +x nngrab
+ aux:	 aux.sh prefix
+ #	cat prefix aux.sh > aux ; chmod +x aux
+ upgrade_rc: upgrade_rc.sh prefix
+ #	cat prefix upgrade_rc.sh > upgrade_rc ; chmod +x upgrade_rc
+ nnacct:  $(ACCT)
+ 	echo "linking nnacct"
+ 	$(CC) -o nnacct $(CFLAGS) $(ACCT) $(LDFLAGS)
+ back_act: back_act.sh prefix
+ #	cat prefix back_act.sh > back_act ; chmod +x back_act
+ nnspew:	nnspew.sh prefix
+ #	cat prefix nnspew.sh > nnspew ; chmod +x nnspew
+ prefix:	config.h mkprefix
+ 	mkprefix >prefix prefix
+ mkprefix:  prefix.o global.o
+ 	$(CC) -o mkprefix $(CFLAGS) prefix.o global.o $(LDFLAGS)
+ update.h:	config.h patchlevel.h # Makefile
+ #	sh -c "[ -f update.h ] || (echo 0 > update.h)"
+ #	sh -c "expr `cat update.h` + 1 > update1.h && mv update1.h update.h"
+ #	echo configuration number updated to `cat update.h`
+ cvt-help:	 config.h cvt-help.c
+ 	$(CC) -o cvt-help cvt-help.c $(LDFLAGS)
+ usercheck:	 config.h usercheck.c
+ 	$(CC) -o usercheck usercheck.c $(LDFLAGS)
+ inst: config.h xmakefile inst.sh cvt-help usercheck mkprefix man/nn.1
+ #	echo building install script: ./inst
+ #	./mkprefix full < /dev/null > inst
+ #	echo BIN_PROG=\"$(BIN_PROG)\" >> inst
+ #	echo BIN_LINK=\"$(BIN_LINK)\" >> inst
+ #	echo LIB_PROG=\"$(LIB_PROG)\" >> inst
+ #	echo MASTER_PROG=\"$(MASTER_PROG)\" >> inst
+ #	cat inst.sh >> inst
+ #	chmod 755 inst
+ man/nn.1:	man/nn.1.A man/nn.1.B man/nn.1.C man/nn.1.D
+ 	-[ ! -f man/nn.1 ] || mv man/nn.1 man/nn.1~
+ 	cat man/nn.1.? > man/nn.1
+ clean:
+ 	rm -f $(BIN_PROG) $(LIB_PROG) $(MASTER_PROG) cvt-help usercheck
+ 	rm -f prefix mkprefix inst
+ 	rm -f man/nn.1 man/nn.1~
+ account.o:	account.c config.h global.h vararg.h options.h proto.h
+ active.o:	active.c config.h global.h vararg.h data.h
+ admin.o:	admin.c config.h global.h vararg.h data.h db.h term.h \
+ 		proto.h
+ answer.o:	answer.c config.h global.h vararg.h data.h news.h term.h \
+ 		keymap.h options.h
+ articles.o:	articles.c config.h global.h vararg.h data.h db.h articles.h
+ collect.o:	collect.c config.h global.h vararg.h data.h db.h news.h
+ db.o:		db.c config.h global.h vararg.h data.h db.h
+ decode.o:	decode.c config.h global.h vararg.h data.h
+ digest.o:	digest.c config.h global.h vararg.h data.h news.h debug.h
+ dir.o:		dir.c config.h global.h vararg.h data.h articles.h dir.h
+ execute.o:	execute.c config.h global.h vararg.h data.h term.h
+ expire.o:	expire.c config.h global.h vararg.h data.h db.h dir.h
+ folder.o:	folder.c config.h global.h vararg.h data.h articles.h news.h \
+ 		term.h menu.h
+ fullname.o:	fullname.c config.h global.h
+ global.o:	global.c config.h global.h vararg.h data.h \
+ 		patchlevel.h
+ # update.h
+ group.o:	group.c config.h global.h vararg.h data.h articles.h db.h \
+ 		term.h menu.h keymap.h regexp.h
+ hostname.o:	hostname.c config.h
+ init.o:		init.c config.h global.h vararg.h data.h articles.h term.h \
+ 		keymap.h menu.h
+ keymap.o:	keymap.c config.h global.h vararg.h data.h keymap.h term.h
+ kill.o:		kill.c config.h global.h vararg.h data.h term.h regexp.h
+ macro.o:	macro.c config.h global.h vararg.h data.h keymap.h term.h
+ master.o:	master.c config.h global.h vararg.h data.h db.h \
+ 		options.h proto.h
+ match.o:	match.c config.h global.h regexp.h
+ menu.o:		menu.c config.h global.h vararg.h data.h articles.h term.h \
+ 		keymap.h menu.h regexp.h
+ more.o:		more.c config.h global.h vararg.h data.h news.h term.h \
+ 		menu.h keymap.h regexp.h
+ news.o:		news.c config.h global.h vararg.h data.h news.h
+ nn.o:		nn.c config.h global.h vararg.h data.h menu.h term.h \
+ 		keymap.h options.h articles.h proto.h
+ nnmail.o:	nnmail.c config.h global.h vararg.h data.h options.h
+ nntp.o:		nntp.c config.h global.h vararg.h data.h nntp.h
+ options.o:	options.c config.h global.h vararg.h data.h options.h
+ pack_date.o:	pack_date.c config.h global.h vararg.h data.h
+ pack_name.o:	pack_name.c config.h global.h vararg.h data.h
+ pack_subject.o:	pack_subject.c config.h global.h vararg.h data.h
+ prefix.o:	config.h global.h
+ proto.o:	proto.c config.h global.h proto.h
+ newsrc.o:	newsrc.c config.h global.h vararg.h data.h term.h debug.h
+ regexp.o:	regexp.c config.h global.h vararg.h data.h regexp.h
+ reroute.o:	reroute.c config.h global.h vararg.h data.h
+ save.o:		save.c config.h global.h vararg.h data.h term.h keymap.h \
+ 		news.h
+ selection.o:	selection.c config.h global.h vararg.h data.h term.h\
+ 		 articles.h
+ sequence.o:	sequence.c config.h global.h vararg.h data.h debug.h
+ sort.o:		sort.c config.h global.h vararg.h data.h
+ term.o:		term.c config.h global.h vararg.h data.h term.h keymap.h
+ unshar.o:	unshar.c config.h global.h vararg.h data.h
+ variable.o:	variable.c config.h global.h vararg.h data.h
+ nn1:	$(NN)
+ 	$(CC) -o nn1 -Mnn1 $(CFLAGS) $(NN) $(LDFLAGS) -ltermlib 
+ nnmaster1: $(MASTER)
+ 	$(CC) -o nnmaster1 -Mnnmaster1 $(CFLAGS) $(MASTER) $(LDFLAGS) 
+ lint:
+ 	echo LINTING NN
+ 	echo LINTING MASTER
diff -c +recursive +new-file nn-6.4.16/master.c ann/master.c
*** nn-6.4.16/master.c	Fri Oct 12 22:44:00 1984
--- ann/master.c	Thu Mar 27 18:11:12 1985
***************
*** 6,11 ****
--- 6,15 ----
   *	maintains the article header database.
   */
  
+ /*
+ 	modified to work with the Amiga by Alexander Rawass
+ */
+ 
  #include <signal.h>
  #include <errno.h>
  #include "config.h"
***************
*** 12,17 ****
--- 16,25 ----
  #include "db.h"
  #include "proto.h"
  
+ #ifdef	AMIGA
+ FILE	*debugfh;
+ #endif
+ 
  import char *bin_directory;
  
  /*
***************
*** 173,178 ****
--- 181,187 ----
  static clean_group_internal(gh)	/* no write */
  register group_header *gh;
  {
+ 
      gh->first_db_article = 0;
      gh->last_db_article = 0;
  
***************
*** 200,205 ****
--- 209,215 ----
  
      clean_group_internal(gh);
  
+ 
      db_write_group(gh);
  }
  
***************
*** 269,274 ****
--- 279,285 ----
  {
      register group_header *gh;
  
+ 
      if (master.free_groups <= 0)
  	db_expand_master();
  
***************
*** 358,366 ****
  
      sprintf(command, "awk 'NF>0{print $1}' %s | sort | uniq -d", news_active);
  
      src = popen(command, "r");
!     if (src == NULL)
! 	sys_error("popen(%s) failed", command);
      
      for (lcount = 0; fgets(groupname, 512, src); lcount++) {
  	if (lcount == 0)
--- 369,380 ----
  
      sprintf(command, "awk 'NF>0{print $1}' %s | sort | uniq -d", news_active);
  
+ #ifndef AMIGA
      src = popen(command, "r");
!     if (src == NULL){
! 		sys_error("popen(%s) failed", command);
! 	}
! 
      
      for (lcount = 0; fgets(groupname, 512, src); lcount++) {
  	if (lcount == 0)
***************
*** 372,377 ****
--- 386,392 ----
  
      pclose(src);
  
+ 
      if (lcount > 0) {
  	printf("Do you want to repair this file before continuing ? (y)");
  	gets(command);
***************
*** 382,387 ****
--- 397,403 ----
  	    nn_exit(0);
  	}
      }
+ #endif
  
      /* if a "GROUPS" file exist offer to use that, else */
      /* read group names from active file */
***************
*** 403,413 ****
      fl;
  
      if (!use_group_file) {
  	sprintf(command, "awk 'NF>0{print $1}' %s | sort -u", news_active);
  
  	src = popen(command, "r");
! 	if (src == NULL)
  	    sys_error("popen(%s) failed", command);
      }
  
      open_master(OPEN_CREATE);
--- 419,440 ----
      fl;
  
      if (!use_group_file) {
+ #ifdef AMIGA
+ 	sprintf(command,"c:type %s",news_active);
+ #else
  	sprintf(command, "awk 'NF>0{print $1}' %s | sort -u", news_active);
+ #endif
  
+ 
+ #ifdef	AMIGA
+ 	src = fopen(news_active,"r");
+ #else
  	src = popen(command, "r");
! #endif
! 
! 	if (src == NULL){
  	    sys_error("popen(%s) failed", command);
+ 	}
      }
  
      open_master(OPEN_CREATE);
***************
*** 432,439 ****
  	    gh->group_name_length = 0;
  	    if (db_parse_group(gh, 0) <= 0) break;
  	} else {
  	    if (fgets(groupname, 512, src) == NULL) break;
! 
  	    gh->group_name_length = strlen(groupname) - 1;	/* strip NL */
  	    groupname[gh->group_name_length] = NUL;
  	    gh->creation_time = 0;
--- 459,478 ----
  	    gh->group_name_length = 0;
  	    if (db_parse_group(gh, 0) <= 0) break;
  	} else {
+ #ifndef AMIGA
  	    if (fgets(groupname, 512, src) == NULL) break;
! #else
! 		{
! 			char	*gname;
! 			int		i;
! 			
! 			gname=fgets(groupname,512,src);
! 			if(gname==NULL) break;
! 			for(i=0;groupname[i]!=' ';i++) ;	
! 			groupname[i]='\n';
! 			groupname[i+1]=0;
! 		}
! #endif
  	    gh->group_name_length = strlen(groupname) - 1;	/* strip NL */
  	    groupname[gh->group_name_length] = NUL;
  	    gh->creation_time = 0;
***************
*** 475,481 ****
--- 514,524 ----
      if (use_group_file)
  	close_groups();
      else
+ #ifdef AMIGA
+ 	fclose(src);
+ #else
  	pclose(src);
+ #endif
  
      printf("%s %s/GROUPS file\n",
  	   use_group_file ? "Updating" : "Building", db_directory);
***************
*** 588,593 ****
--- 631,640 ----
      int skip_pass;
      long pass_no;
  
+ #ifdef	AMIGA
+ 	debugfh=fopen("*","w");
+ #endif
+ 
      umask(002);			/* avoid paranoia */
  
      who_am_i = I_AM_MASTER;
***************
*** 687,692 ****
--- 734,740 ----
  	    nn_exit(0);
      }
  
+ 
      if (!ignore_lock && master.db_lock[0]) {
  	printf("Database locked (unlock with -l or ignore with -i)\n");
  	nn_exit(88);
***************
*** 704,709 ****
--- 752,758 ----
      }
  
      if (repeat_delay && !debug_mode && !foreground) {
+ 
  	while ((temp = fork()) < 0) sleep(1);
  	if (temp) exit(0);	/* not nn_exit() !!! */
  
***************
*** 720,725 ****
--- 769,775 ----
  	      repeat_delay, expire_level,
  	      expire_once ? "-F " : "", expire_method);
  
+ 
      if (check_on_startup) {
  	char cmd[FILENAME];
  	sprintf(cmd, "%s/nnadmin Z", bin_directory);
***************
*** 731,738 ****
  
      init_digest_parsing();
  
-     open_master(OPEN_UPDATE);
  
      if (group_selection)
  	set_group_restrictions(argv + 1, group_selection);
  
--- 781,788 ----
  
      init_digest_parsing();
  
  
+     open_master(OPEN_UPDATE);
      if (group_selection)
  	set_group_restrictions(argv + 1, group_selection);
  
***************
*** 800,810 ****
  	    continue;
  	}
  
  	visit_active_file();
  
! 	if (do_expire())
  	    if (!expire_once && do_collect())
  		master.last_scan = age_active;
  
  	db_write_master();
  
--- 850,862 ----
  	    continue;
  	}
  
+ 
  	visit_active_file();
  
! 	if (do_expire()){
  	    if (!expire_once && do_collect())
  		master.last_scan = age_active;
+ 	}
  
  	db_write_master();
  
***************
*** 836,841 ****
--- 888,894 ----
      register group_header *gh;
      FILE *open_gate_file();
  
+ 
      gate = open_gate_file(OPEN_READ);
      if (gate == NULL) return 0;
  
***************
*** 869,874 ****
--- 922,928 ----
  	log_entry('A', "RECV %c %s %c %ld (%s)",
  		  command, gh == NULL ? "(all)" : gh->group_name, opt, arg, user_date);
  
+ 
  	switch (command) {
  
  	 case SM_SET_OPTION:
***************
*** 909,920 ****
  
  	 case SM_RECOLLECT:	/* recollect */
  	    if (gh) {
! 		if ((gh->master_flag & M_IGNORE_GROUP) == 0)
  		    clean_group(gh);
  	    } else
  		Loop_Groups_Header(gh)
! 		    if ((gh->master_flag & M_IGNORE_GROUP) == 0)
  			clean_group(gh);
  	    break;
  
  	 case SM_SCAN_ONCE:	/* unconditional pass */
--- 963,976 ----
  
  	 case SM_RECOLLECT:	/* recollect */
  	    if (gh) {
! 		if ((gh->master_flag & M_IGNORE_GROUP) == 0){
  		    clean_group(gh);
+ 		}
  	    } else
  		Loop_Groups_Header(gh)
! 		    if ((gh->master_flag & M_IGNORE_GROUP) == 0){
  			clean_group(gh);
+ 			}
  	    break;
  
  	 case SM_SCAN_ONCE:	/* unconditional pass */
diff -c +recursive +new-file nn-6.4.16/menu.c ann/menu.c
*** nn-6.4.16/menu.c	Fri Oct 12 22:44:00 1984
--- ann/menu.c	Mon Mar 24 19:12:26 1985
***************
*** 82,87 ****
--- 82,90 ----
      int mi_total;	/* total number of articles with this subject */
      int mi_unread;	/* no of unread articles with this subject */
      int mi_selected;	/* no of selected articles with this subject */
+ #ifdef PATCH18
+     int mi_left;	/* no of articles marked for later viewing */
+ #endif /* PATCH18 */
      int mi_art_id;	/* article id (for mark()) */
  } menu_info[INTERVAL1+INTERVAL2];
  
***************
*** 138,146 ****
--- 141,151 ----
      if (ah->flag & A_ROOT_ART)
  	return root;
  
+ #ifndef PATCH18
      if (ah->flag & A_CLOSED)	/* only root article is shown on menu */
  	return firsta + menu_info[ah->menu_line].mi_cura;
  
+ #endif /* PATCH18 */
      while (root > 0) {
  	if (articles[root]->flag & A_ROOT_ART) break;
  	root--;
***************
*** 172,187 ****
--- 177,203 ----
  {
      register struct menu_info *mi;
      register article_number n;
+ #ifndef PATCH18
      int total, unread, selected, invisible;
+ #else
+     int total, unread, selected, left, invisible;
+ #endif /* PATCH18 */
      
      if (!(articles[art]->flag & A_CLOSED)) return art + 1;
      
+ #ifndef PATCH18
      total = unread = selected = 0;
+ #else
+     total = unread = selected = left = 0;
+ #endif /* PATCH18 */
      n = art = root_article(art);
  
      while (n < n_articles) {
  	if (articles[n]->attr == 0) unread++;
  	else if (articles[n]->attr & A_SELECT) selected++; 
+ #ifdef PATCH18
+ 	else if (articles[n]->attr == A_LEAVE_NEXT) left++;
+ #endif /* PATCH18 */
  	total++;
  	if (++n == n_articles) break;
  	if (articles[n]->flag & A_ROOT_ART) break;
***************
*** 192,197 ****
--- 208,216 ----
      mi->mi_total = total;
      mi->mi_unread = unread;
      mi->mi_selected = selected;
+ #ifdef PATCH18
+     mi->mi_left = left;
+ #endif /* PATCH18 */
      return n;
  }
  
***************
*** 206,215 ****
--- 225,244 ----
  register struct menu_info *mi;
  char *cbuf;
  {
+ #ifndef PATCH18
      char sel[10], unr[10];
+ #else
+     char lft[10], sel[10], unr[10];
+ #endif /* PATCH18 */
      attr_type cattr;
      
+ #ifndef PATCH18
      if (mi->mi_unread == 0)
+ #else
+     if (mi->mi_total == mi->mi_left)
+ 	cattr = A_LEAVE_NEXT;
+     else if (mi->mi_unread == 0)
+ #endif /* PATCH18 */
  	cattr = A_READ;
      else if (mi->mi_total == mi->mi_selected)
  	cattr = A_SELECT;
***************
*** 220,231 ****
--- 249,270 ----
      else
  	cattr = 0;
  
+ #ifndef PATCH18
      sel[0] = unr[0] = NUL;
+ #else
+     lft[0] = sel[0] = unr[0] = NUL;
+     if (mi->mi_left && mi->mi_left < mi->mi_unread)
+ 	sprintf(lft, "%d,", mi->mi_left);
+ #endif /* PATCH18 */
      if (mi->mi_selected && mi->mi_selected < mi->mi_unread)
  	sprintf(sel, "%d/", mi->mi_selected);
      if (mi->mi_unread && mi->mi_unread < mi->mi_total)
  	sprintf(unr, "%d:", mi->mi_unread);
+ #ifndef PATCH18
      sprintf(cbuf, "%s%s%d", sel, unr, mi->mi_total);
+ #else
+     sprintf(cbuf, "%s%s%s%d", lft, sel, unr, mi->mi_total);
+ #endif /* PATCH18 */
  
      return cattr;
  }
***************
*** 268,273 ****
--- 307,315 ----
  	thread_counters(firsta + cura);
  	if (old.mi_total == mi->mi_total &&
  	    old.mi_selected == mi->mi_selected &&
+ #ifdef PATCH18
+ 	    old.mi_left == mi->mi_left &&
+ #endif /* PATCH18 */
  	    old.mi_unread == mi->mi_unread) return;
  
  	cattr = closed_attr(mi, cbuf);
***************
*** 399,406 ****
--- 441,452 ----
  	else {
  	    if (collapse_subject > 0)
  		so_printf("%-.*s", collapse_subject, ah->subject);
+ #ifndef PATCH17
  	    lsubj -= 2 + collapse_subject;
  	    so_printf("<>%s", ah->subject + ah->subj_length - lsubj);
+ #else
+ 	    so_printf("<>%s", ah->subject + ah->subj_length - lsubj + collapse_subject + 2);
+ #endif /* PATCH17 */
  	}
      }
  
***************
*** 408,414 ****
--- 454,465 ----
  	so_printf(ah->lines >= 0 ? " +%d" : " +?", ah->lines);
  
      so_end();
+ #ifndef PATCH17
      if (ah->flag & A_CLOSED) clrline_noflush();
+ #else
+     if ((ah->flag & A_CLOSED) && lsubj > ah->subj_length)
+         clrline_noflush();
+ #endif /* PATCH17 */
  
   out:
      ah->disp_attr = last_attr;
***************
*** 455,461 ****
--- 506,516 ----
  {
      register article_number i;
      register article_header *ah, **ahp;
+ #ifndef PATCH17
      int count = 0, o_cura;
+ #else
+     int count = 0, o_cura, should_mark;
+ #endif /* PATCH17 */
      extern int kill_file_loaded;
  
      if (mode == 1 && re == NULL) 
***************
*** 462,474 ****
--- 517,548 ----
  	if (!kill_file_loaded && !init_kill()) return 0;
  
      o_cura = cura;
+ #ifndef PATCH17
      cura = -1;
+ #else
+     should_mark = 0;
+ #endif /* PATCH17 */
  
+ #ifdef PATCH17
+     /*
+      * note: this code assumes that a visible article will be found
+      * before anything is marked
+      */
+ #endif
      for (i = 0, ahp = articles; i < n_articles; i++, ahp++) {
  	ah = *ahp;
+ #ifndef PATCH17
  	if (cura >= 0 && (ah->flag & A_ROOT_ART)) {
  	    mark();
  	    cura = -1;
+ #else
+ 	if (IS_VISIBLE(ah)) {
+ 	    if (should_mark) {
+ 		mark();
+ 		should_mark = 0;
+ 	    }
+ 	    cura = i - firsta;
+ #endif /* PATCH17 */
  	}
  	if (re != NULL) {
  	    if (!regexec_cf(re, select_on_sender ? ah->sender : ah->subject)) continue;
***************
*** 478,483 ****
--- 552,558 ----
  	count++;
  	if (ah->attr & A_SELECT) continue;
  	ah->attr = A_SELECT;
+ #ifndef PATCH17
  	if (firsta <= i && i <= (firsta+numa)) {
  	    cura = i - firsta;
  	    if ((ah->flag & A_CLOSED) == 0) {
***************
*** 485,493 ****
--- 560,576 ----
  		cura = -1;
  	    }
  	}
+ #else
+ 	if (firsta <= i && i <= (firsta+numa))
+ 	    should_mark = 1;
+ #endif /* PATCH17 */
      }
  
+ #ifndef PATCH17
      if (cura >= 0) mark();
+ #else
+     if (should_mark) mark();
+ #endif /* PATCH17 */
  
      if (count)
  	msg("Selected %d article%s", count, plural((long)count));
***************
*** 617,624 ****
--- 700,723 ----
  
  	     case MC_MENU:
  		ah->attr = o_attr;
+ #ifndef PATCH18
  		if (nexta - firsta < n_articles)
  		    if ((firsta = cur - 5) < 0) firsta = 0;
+ #else
+ 		if (nexta - firsta < n_articles) {
+ 			/* Keep a little article context by making the */
+ 			/* current article go on menu line 6 if possible */
+ 			if (IS_VISIBLE(articles[cur]))
+ 				firsta = cur;
+ 			else
+ 				firsta = root_article(cur);
+ 			for (next = 0; firsta > 0 && next < 5; next++) {
+ 				firsta--;
+ 				if (!IS_VISIBLE(articles[firsta]))
+ 					firsta = root_article(firsta);
+ 			}
+ 		}
+ #endif /* PATCH18 */
  		next_cura = cur - firsta;
  
  		return MC_MENU;
***************
*** 725,731 ****
--- 824,834 ----
  	article_id = map & ~K_ARTICLE_ID;
  	map = K_ARTICLE_ID;
  
+ #ifndef PATCH17
  	if (article_id < 0 || article_id > menu_articles) {
+ #else
+ 	if (article_id < 0 || article_id >= menu_articles) {
+ #endif /* PATCH17 */
  	    ding();
  	    goto loop;
  	}
***************
*** 817,824 ****
--- 920,937 ----
  attr_type old, new;
  int update;
  {
+ #ifndef PATCH18
      return repl_attr(root_article(firsta+cura), next_root_article(firsta+cura),
  		     old, new, update);
+ #else
+     int	f, l;
+ 
+     f = root_article(firsta+cura);
+     l = next_root_article(firsta+cura);
+     if (old == A_SELECT)
+ 	(void) repl_attr(f, l, A_AUTO_SELECT, A_SELECT, update);
+     return repl_attr(f, l, old, new, update);
+ #endif /* PATCH18 */
  }
  
  static repl_attr_all(old, new, update)
***************
*** 1639,1644 ****
--- 1752,1760 ----
  	 }
  	 cura = article_id;
  	 next_cura = next_root_article(firsta + cura) - firsta;
+ #ifdef PATCH17
+ 	 if (next_cura < 0 || next_cura > numa) next_cura = 0;
+ #endif /* PATCH17 */
  	 if (cura >= 0) goto partial_redraw_nc;
  	 articles[cura + firsta]->menu_line = articles[firsta]->menu_line;
  	 firsta += cura;
diff -c +recursive +new-file nn-6.4.16/more.c ann/more.c
*** nn-6.4.16/more.c	Fri Oct 12 22:44:00 1984
--- ann/more.c	Thu Mar 27 18:45:45 1985
***************
*** 21,27 ****
--- 21,35 ----
  export char *header_lines = NULL;
  export int  min_pv_window = 7;
  export int  wrap_headers = 6;
+ 
+ /* AMIGA is 8 bit, so set data_bits to 8 as default */
+ 
+ #ifndef AMIGA
  export int  data_bits = 7;
+ #else
+ export int  data_bits = 8;
+ #endif
+ 
  export int  scroll_clear_page = 1;
  export int  expired_msg_delay = 1;
  export char *trusted_escapes = NULL;
diff -c +recursive +new-file nn-6.4.16/newsrc.c ann/newsrc.c
*** nn-6.4.16/newsrc.c	Fri Oct 12 22:44:00 1984
--- ann/newsrc.c	Thu Mar 27 18:13:29 1985
***************
*** 10,15 ****
--- 10,19 ----
  #include "term.h"
  #include "articles.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  #ifdef sel
  /* Remove Gould SELbus software name collision */
  #undef sel
***************
*** 156,162 ****
--- 160,177 ----
      if (dump_file(newsrc_file, DM_NEWSRC)) {
  	extern char *tmp_directory;
  	char temp[FILENAME];
+ 
+ #ifdef	AMIGA
+ 	if(tmp_directory[strlen(tmp_directory)-1]==':'){
+ 		sprintf(temp, "%snewsrc-%d", tmp_directory, process_id);
+ 	}
+ 	else{
+ 		sprintf(temp, "%s/newsrc-%d", tmp_directory, process_id);
+ 	}
+ #else
  	sprintf(temp, "%s/newsrc-%d", tmp_directory, process_id);
+ #endif
+ 
  	if (dump_file(temp, DM_NEWSRC))
  	    user_error("Cannot update %s -- restore %s file!!!",
  		       newsrc_file, bak_suffix);
***************
*** 1256,1262 ****
      Loop_Groups_Sequence(gh) {
  	gh->unread_count = 0;
  
! 	if (gh->master_flag & M_NO_DIRECTORY) continue;
  
  	if (gh->last_db_article > gh->last_article) {
  	    n = unread_articles;
--- 1271,1279 ----
      Loop_Groups_Sequence(gh) {
  	gh->unread_count = 0;
  
! 	if (gh->master_flag & M_NO_DIRECTORY){
! 		 continue;
! 	}
  
  	if (gh->last_db_article > gh->last_article) {
  	    n = unread_articles;
diff -c +recursive +new-file nn-6.4.16/nn.c ann/nn.c
*** nn-6.4.16/nn.c	Fri Oct 12 22:44:00 1984
--- ann/nn.c	Thu Mar 27 18:14:23 1985
***************
*** 4,9 ****
--- 4,13 ----
   *	The nn user interface main program
   */
  
+ /*
+ 	modified to work with the Amiga by Alexander Rawass
+ */
+ 
  #include "config.h"
  #include "menu.h"
  #include "term.h"
***************
*** 15,20 ****
--- 19,29 ----
  #include <malloc.h>
  #endif
  
+ #ifdef	AMIGA
+ FILE	*debugfh;
+ extern	unsigned	long	_Heapsize;
+ #endif
+ 
  import char *bin_directory;
  
  import int
***************
*** 679,684 ****
--- 688,699 ----
      extern long initial_memory_break;
      extern char *sbrk();
  
+ #ifdef AMIGA
+ 	_Heapsize=150*1024L;
+ 
+ 	debugfh=fopen("*","w");
+ #endif
+ 
      initial_memory_break = (long)sbrk(0);
  
  #ifdef USE_MALLOC_H
***************
*** 695,700 ****
--- 710,735 ----
  
      pname = program_name(argv);
  
+ #ifdef	AMIGA
+ {
+ int	i,be;
+ 
+ 	be=-1;
+ 	for(i=0;i<argc;i++){
+ 		if(strcmp(argv[i],"-be")==0){
+ 			pname=argv[i+1];
+ 			be=i;
+ 		}
+ 	}
+ 	
+ 	if(be!=-1){
+ 		for(i=be;i<argc-2;i++){
+ 			argv[i]=argv[i+2];
+ 		}
+ 	}
+ }
+ #endif	
+ 
      if (strcmp(pname, "nnadmin") == 0) {
  	who_am_i = I_AM_ADMIN;
      } else
***************
*** 984,990 ****
  		prompt_line = 2;
  		cmd = goto_group(K_GOTO_GROUP, (article_header *)NULL, setup_access());
  		
! 		if (cmd == ME_NO_REDRAW) sleep(2);
  	    } while (repeat_group_query && cmd != ME_QUIT && cmd != ME_NO_REDRAW);
  	    clrdisp();
  	    unset_raw();
--- 1019,1027 ----
  		prompt_line = 2;
  		cmd = goto_group(K_GOTO_GROUP, (article_header *)NULL, setup_access());
  		
! 		if (cmd == ME_NO_REDRAW){
! 			sleep(2);
! 		}
  	    } while (repeat_group_query && cmd != ME_QUIT && cmd != ME_NO_REDRAW);
  	    clrdisp();
  	    unset_raw();
***************
*** 1025,1031 ****
  	do_grep(argv+1);
  	break;
      }
- 
      nn_exit(0);
      /*NOTREACHED*/
  }
--- 1062,1067 ----
diff -c +recursive +new-file nn-6.4.16/nnmail.c ann/nnmail.c
*** nn-6.4.16/nnmail.c	Fri Oct 12 22:44:00 1984
--- ann/nnmail.c	Fri Mar 28 09:54:28 1985
***************
*** 9,14 ****
--- 9,18 ----
  
  #include "options.h"
  
+ #ifdef	AMIGA
+ FILE	*debugfh;
+ #endif
+ 
  char * MAILER = MAILX;
  static int print_vers, test_mode;
  
***************
*** 30,35 ****
--- 34,43 ----
      char route[512];
      char *getenv(), *envmail;
      extern char **environ;
+ 
+ #ifdef	AMIGA
+ 	debugfh=fopen("*","w");
+ #endif
  
      if (envmail = getenv("NNMAILER"))
  	MAILER = envmail;
diff -c +recursive +new-file nn-6.4.16/patchlevel.h ann/patchlevel.h
*** nn-6.4.16/patchlevel.h	Fri Oct 12 22:44:00 1984
--- ann/patchlevel.h	Mon Mar 24 18:29:17 1985
***************
*** 27,33 ****
--- 27,43 ----
   *	1991-03-22: Patch #14 (6.4.14) - MEDIUM
   *	1991-04-02: Patch #15 (6.4.15) - LOW
   *	1991-04-18: Patch #16 (6.4.16) - HIGH
+ #ifdef PATCH18
+  *
+  *	(Kim lost interest/dissapeared)
+  *
+  *	1991-11-19: Patch #17 (6.4.17) - MEDIUM
+  *	1991-12-01: Patch #18 (6.4.18) - MEDIUM
   */
  
+ #ifndef PATCH18
  #define PATCHLEVEL 16
+ #else
+ #define PATCHLEVEL 18
+ #endif /* PATCH18 */
  
diff -c +recursive +new-file nn-6.4.16/proto.c ann/proto.c
*** nn-6.4.16/proto.c	Fri Oct 12 22:44:00 1984
--- ann/proto.c	Fri Mar 28 09:55:14 1985
***************
*** 10,15 ****
--- 10,19 ----
  #include <pwd.h>
  #include "proto.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  #ifndef ACCOUNTING
  #ifdef AUTHORIZE
  #define ACCOUNTING
***************
*** 224,229 ****
--- 228,234 ----
  long arg;
  {
      FILE *gate;
+ 
  
      gate = open_gate_file(OPEN_APPEND);
  
diff -c +recursive +new-file nn-6.4.16/readconfig.c ann/readconfig.c
*** nn-6.4.16/readconfig.c
--- ann/readconfig.c	Mon Mar 24 14:58:17 1985
***************
*** 0 ****
--- 1,99 ----
+ /*
+ 	reads the config file of your UUCP installation
+ 	
+ 	by Alexander Rawass, a_rawass@informatik.uni-kl.de
+ */
+ 
+ #include <exec/types.h>
+ #include <stdio.h>
+ 
+ #include "readconfig.h"
+ 
+ #define	LMAX	200
+ 
+ #define	CONFIGLINE(x)	(!(strncmp(x,lbuf,strlen(x))))
+ 
+ VOID	stripM(buf)
+ STRPTR	buf;
+ {
+ 	int	i;
+ 
+ 	for(i=0;buf[i]!='\n' && buf[i]!=0;i++){
+ 		if(buf[i]==0x0d){
+ 			buf[i]=0;
+ 		}
+ 	}
+ 	buf[i]=0;
+ }
+ 
+ STRPTR	confname(buf)
+ STRPTR	buf;
+ {
+ int	i;
+ 
+ 	for(i=0;buf[i]!=' ' && buf[i]!=0x09;i++)	;	/* find first space */
+ 	
+ 	for(;buf[i]==' ' || buf[i]==0x09;i++)	; /* find first non-space */
+ 	
+ 	return(buf+i);
+ }
+ 
+ BOOL	readconfig(name,conf)
+ STRPTR	name;
+ struct	uuconfig	*conf;
+ {
+ FILE	*fh;
+ char	lbuf[LMAX];
+ 
+ 	fh=fopen(name,"r");
+ 	
+ 	if(fh==NULL){
+ 		return(FALSE);
+ 	}
+ 	
+ 	fgets(lbuf,LMAX,fh);
+ 	while(!feof(fh)){
+ 		stripM(lbuf);
+ 		if(CONFIGLINE("NodeName")){
+ 			strcpy(conf->NodeName,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("UserName")){
+ 			strcpy(conf->UserName,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("RealName")){
+ 			strcpy(conf->RealName,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("Organization")){
+ 			strcpy(conf->Organization,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("DomainName")){
+ 			strcpy(conf->DomainName,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("Editor")){
+ 			strcpy(conf->Editor,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("MailCommand")){
+ 			strcpy(conf->MailCommand,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("NewsCommand")){
+ 			strcpy(conf->NewsCommand,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("SaveFolder")){
+ 			strcpy(conf->SaveFolder,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("NewsSignature")){
+ 			strcpy(conf->NewsSignature,confname(lbuf));
+ 		}
+ 		else if(CONFIGLINE("MailSignature")){
+ 			strcpy(conf->MailSignature,confname(lbuf));
+ 		}
+ 		fgets(lbuf,LMAX,fh);
+ 	}
+ 	
+ 	fclose(fh);
+ 	
+ 	return(TRUE);
+ }
+ 
+ 
+ 
diff -c +recursive +new-file nn-6.4.16/readconfig.h ann/readconfig.h
*** nn-6.4.16/readconfig.h
--- ann/readconfig.h	Mon Mar 24 14:58:17 1985
***************
*** 0 ****
--- 1,19 ----
+ #define	UUMAX	200
+ #define	LMAX	200
+ 
+ struct	uuconfig {
+ 	/* for UUCP	*/
+ 	char	NodeName[UUMAX];
+ 	char	UserName[UUMAX];
+ 	char	RealName[UUMAX];
+ 	char	Organization[UUMAX];
+ 	char	DomainName[UUMAX];
+ 	/* for Amiga-NN */
+ 	char	Editor[UUMAX];
+ 	char	MailCommand[UUMAX];
+ 	char	NewsCommand[UUMAX];
+ 	char	SaveFolder[UUMAX];
+ 	char	NewsSignature[UUMAX];
+ 	char	MailSignature[UUMAX];
+ };
+ 
diff -c +recursive +new-file nn-6.4.16/save.c ann/save.c
*** nn-6.4.16/save.c	Fri Oct 12 22:44:00 1984
--- ann/save.c	Fri Mar 28 09:56:36 1985
***************
*** 11,17 ****
--- 11,28 ----
  #include "keymap.h"
  #include "news.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
+ /* to be compatible with ARN, AMIGA will use +$G */
+ 
+ #ifdef	AMIGA
+ export char *default_save_file = "+$G";
+ #else
  export char *default_save_file = "+$F";
+ #endif
+ 
  export char *folder_save_file = NULL;
  export int suggest_save_file = 1;
  export char *unshar_header_file = "Unshar.Headers";
***************
*** 143,148 ****
--- 154,161 ----
  	    continue;
  	}
  	*slash = NUL;
+ 	
+ 
  	if (mkdir(name, 0755)) {
  	    msg("Cannot make %s/", name);
  	    *slash = '/';
***************
*** 218,223 ****
--- 231,237 ----
  	    }
  
  	    save_name = get_s(last_input, save_name, NONE, file_completion);
+ 
  	    if (save_name == NULL || *save_name == NUL) return NULL;
  
  	    if (save_name[1] == NUL && save_name[0] == '+')
***************
*** 727,732 ****
--- 741,747 ----
  	msg("Directory %s already exists", dir);
  	return NULL;
      }
+ 
  
      if (mkdir(dir, 0755)) {
  	msg("Cannot make %s", dir);
diff -c +recursive +new-file nn-6.4.16/sequence.c ann/sequence.c
*** nn-6.4.16/sequence.c	Fri Oct 12 22:44:00 1984
--- ann/sequence.c	Fri Mar 28 09:57:32 1985
***************
*** 7,12 ****
--- 7,16 ----
  #include "config.h"
  #include "debug.h"
  
+ #ifdef	AMIGA
+ extern	FILE	*debugfh;
+ #endif
+ 
  export group_header *group_sequence;
  export char *read_mail = NULL;
  export int also_subgroups = 1;
***************
*** 94,101 ****
  
      gh->group_flag |= G_SEQUENCE;
  
!     if (gh->master_flag & M_NO_DIRECTORY)
  	return 0;		/* for nntidy -s */
  
      switch (mode) {
       case SHOW_FIRST:
--- 98,106 ----
  
      gh->group_flag |= G_SEQUENCE;
  
!     if (gh->master_flag & M_NO_DIRECTORY){
  	return 0;		/* for nntidy -s */
+ 	}
  
      switch (mode) {
       case SHOW_FIRST:
diff -c +recursive +new-file nn-6.4.16/simplenews.c ann/simplenews.c
*** nn-6.4.16/simplenews.c
--- ann/simplenews.c	Mon Mar 24 14:51:02 1985
***************
*** 0 ****
--- 1,91 ----
+ /*
+ 	Simplenews
+ 
+ 	by Alexander Rawass, a_rawass@informatik.uni-kl.de
+ */
+ 
+ #include <stdio.h>
+ #include <exec/types.h>
+ #include <time.h>
+ 
+ #include "readconfig.h"
+ 
+ #define	LMAX 200
+ #define	LAST_SIMPLENEWS	"t:last.simplenews"
+ 
+ time_t cur_time()
+ {
+     time_t t;
+ 
+     time(&t);
+     return t;
+ }
+ 
+ int	main(argc,argv)
+ int	argc;
+ STRPTR	argv[];
+ {
+ FILE	*ifh;
+ FILE	*ofh;
+ FILE	*sfh;
+ char	wname[100];
+ char	combuf[100];
+ char	buf[LMAX];
+ time_t now;
+ extern struct tm *gmtime();
+ extern char *asctime();
+ char *date;
+ int	ok;
+ struct	uuconfig	conf;
+ 
+ 	if(argc<2){
+ 		exit(42);
+ 	}
+ 	
+ 	if(readconfig("uulib:config",&conf)==FALSE
+ 		|| readconfig("uulib:.nnrc",&conf)==FALSE){
+ 		exit(117);		
+ 	}
+ 	
+ 	ifh=fopen(argv[1],"r");
+ 	
+ 	sprintf(wname,"%s.simplenews",argv[1]);
+ 	ofh=fopen(wname,"w");
+ 
+ 	fprintf(ofh,"Path: %s!%s\n",conf.NodeName,conf.UserName);
+ 	fprintf(ofh,"From: %s@%s%s (%s)\n",conf.UserName,conf.NodeName,conf.DomainName,conf.RealName);
+ 	fprintf(ofh,"Distribution: world\n");
+ 	fprintf(ofh,"Organization: %s\n",conf.Organization);
+ 
+     now = cur_time();
+ 	date = asctime(gmtime(&now));
+     date[3] = date[7] = date[10] = date[19] = date[24] = 0;
+ 
+     fprintf(ofh, "Date: %s %s %s %s GMT\n", date+8, date+4, date+22, date+11);
+ 	fprintf(ofh, "Message-ID: <%s.%ld@%s%s>\n",conf.UserName,(long)now,conf.NodeName,conf.DomainName );
+ 
+ 	fgets(buf,LMAX,ifh);
+ 	while(!feof(ifh)){
+ 		fputs(buf,ofh);
+ 		fgets(buf,LMAX,ifh);
+ 	}
+ 	
+ 	fclose(ifh);
+ 
+ 	sfh=fopen(conf.NewsSignature,"r");
+ 	fgets(buf,LMAX,sfh);
+ 	while(!feof(sfh)){
+ 		fputs(buf,ofh);
+ 		fgets(buf,LMAX,sfh);
+ 	}
+ 	fclose(sfh);
+ 	
+ 	fclose(ofh);
+ 
+ 	sprintf(combuf,"relaynews <%s -i",wname);
+ 	ok=system(combuf);
+ 	
+ 	unlink(wname);
+ 	
+ 	exit(ok);
+ }
diff -c +recursive +new-file nn-6.4.16/term.c ann/term.c
*** nn-6.4.16/term.c	Fri Oct 12 22:44:00 1984
--- ann/term.c	Wed Mar 05 10:05:30 1985
***************
*** 112,123 ****
--- 112,129 ----
  extern char fake_keyb_siglist[];
  #endif
  
+ #ifdef	AMIGA
+ #undef	HAVE_TERMIO
+ #endif
+ 
  #ifdef HAVE_TERMIO
  
  #define KEY_BURST 50	/* read bursts of 50 chars (or timeout after 100 ms) */
  
+ #ifndef AMIGA
  #ifdef USE_TERMCAP
  #include <termio.h>
+ #endif
  #endif
  
  #undef CBREAK
diff -c +recursive +new-file nn-6.4.16/update.h ann/update.h
*** nn-6.4.16/update.h	Wed Feb 06 06:37:00 1985
--- ann/update.h
***************
*** 1 ****
- 5
--- 0 ----
