Trn patch #2 (part 2 of 2)

davison%borla at kithrup.com davison%borla at kithrup.com
Sun Jan 20 20:11:22 AEST 1991


Here is patch #2 for trn (producing v1.0.2).  Part 2 of 2  ** Please apply **

To extract this from trn, type "e dir" where dir is the directory you want
the patch placed.  Otherwise, delete everything through the first cut line
and run it through sh.  Be sure to unpack part 1 of this patch in a similar
manner and then follow the directions in the file patch2a.
-- 
 \  /| / /|\/ /| /(_)     Wayne Davison
(_)/ |/ /\|/ / |/  \      0004475895 at mcimail.com (preferred)
   (W   A  Y   N   e)     davison at dri.com (...!uunet!drivax!davison)
----8<------8<------8<------8<-----cut here----->8------>8------>8------>8----
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	patch2b
# This archive created: Fri Jan 19 20:02:31 1991
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'patch2b'" '(63583 characters)'
if test -f 'patch2b'
then
	echo shar: "will not over-write existing file 'patch2b'"
else
cat << \SHAR_EOF > 'patch2b'
Trn patch #2 PART 2 OF 2.

See the file patch2a for instructions on how to install this patch and for a
brief list of what has changed.

Index: rn.c
Prereq: v1.0.1
@@ -10,8 +10,11 @@
=*/
=
-static char rnid[] = "@(#)$Header: rn.c,v 4.3.3.2 90/08/20 16:48:19 davison Trn $";
-static char patchlevel[] = "Trn v1.0.1 based on Rn patchlevel 47";
+static char rnid[] = "@(#)$Header: rn.c,v 4.3.3.3 91/01/16 03:28:42 davison Trn $";
+static char patchlevel[] = "Trn v1.0.2 based on Rn patchlevel 54";
=
=/* $Log:	rn.c,v $
+ * Revision 4.3.3.3  91/01/16  03:28:42  davison
+ * Integrated rn patches 48-54.  Fixed in_char and verify interaction.
+ * 
= * Revision 4.3.3.2  90/08/20  16:48:19  davison
= * Changed unthreaded group's default action, version #, email address.
@@ -20,4 +23,25 @@
= * Initial Trn Release
= * 
+ * Revision 4.3.2.11  91/01/04  22:58:24  sob
+ * Checkpoint for patch 54
+ * 
+ * Revision 4.3.2.10  90/12/30  22:58:24  sob
+ * Checkpoint for patch 53
+ * 
+ * Revision 4.3.2.9  90/12/13  22:58:24  sob
+ * Checkpoint for patch 52
+ * 
+ * Revision 4.3.2.8  90/12/10  01:35:43  sob
+ * Checkpoint for patch 51
+ * 
+ * Revision 4.3.2.7  90/11/23  20:30:43  sob
+ * Checkpoint for patch 50
+ * 
+ * Revision 4.3.2.6  90/11/22  13:55:23  sob
+ * Checkpoint for patch #49
+ * 
+ * Revision 4.3.2.5  90/11/06  01:19:43  sob
+ * Checkpoint for patch 48
+ * 
= * Revision 4.3.2.4  90/04/03  23:11:33  sob
= * Added more information to the version command.
@@ -215,6 +239,6 @@
=		    IF(verbose)
=			sprintf(promptbuf,
-			    "\n******** %3ld unread article%c in %s--read now? [%s] ",
-			    (long)toread[ng], (toread[ng]==TR_ONE ? ' ' : 's'),
+			    "\n******** %3ld unread article%s in %s--read now? [%s] ",
+			    (long)toread[ng], (toread[ng]==TR_ONE ? nullstr : "s"),
=			    ngname, dfltcmd);	/* format prompt string */
=		    ELSE
@@ -385,6 +409,9 @@
=		    in_char("\nReally? [ynh] ", 'C');
=#endif
-		    putchar('\n') FLUSH;
=		    setdef(buf,"y");
+#ifdef VERIFY
+		    printcmd();
+#endif
+		    putchar('\n') FLUSH;
=		    if (*buf == 'h') {
=#ifdef VERBOSE
@@ -590,3 +617,2 @@
=    return myngdir;
=}
-
Index: mthreads.c
@@ -1,5 +1,9 @@
-/* $Header: mthreads.c,v 4.3.3.2 90/08/20 16:43:19 davison Trn $
+/* $Header: mthreads.c,v 4.3.3.3 91/01/18 19:05:00 davison Trn $
=**
=** $Log:	mthreads.c,v $
+** Revision 4.3.3.3  91/01/18  19:05:00  davison
+** Modified the way signals are handled to avoid endless loops.  Added -s & -z
+** options.  Fixed a truncate bug and a problem with new groups not processing.
+** 
=** Revision 4.3.3.2  90/08/20  16:43:19  davison
=** Implemented new command-line interface and database upgrading.
@@ -68,6 +72,6 @@
=
=bool force_flag = FALSE, kill_mthreads = FALSE, no_processing = FALSE;
-bool add_new = FALSE, rebuild = FALSE, grevious_error;
-int daemon_delay = 0, log_verbosity = 0, debug = 0;
+bool add_new = FALSE, rebuild = FALSE, zap_thread = FALSE, grevious_error;
+int daemon_delay = 0, log_verbosity = 0, debug = 0, slow_down = 0;
=long expire_time = 0;
=char *hierarchy_list = NULL;
@@ -99,6 +103,6 @@
=#endif
=
-char *thread_name(), *file_exp();
-void makethreads(), interrupt(), alarm_handler(), wrap_it_up();
+SIGRET alarm_handler(), int_handler(), severe_handler();
+void makethreads(), wrap_it_up();
=
=main( argc, argv )
@@ -168,7 +172,13 @@
=		    no_processing = TRUE;
=		    break;
+		case 's':
+		    slow_down++;
+		    break;
=		case 'v':
=		    log_verbosity++;
=		    break;
+		case 'z':
+		    zap_thread = TRUE;
+		    break;
=		default:
=		    fprintf( stderr, "Unknown option: '%c'\n", **argv );
@@ -226,5 +236,6 @@
=	}
=	fclose( fp_lock );
-	if( kill( otherpid, kill_mthreads ? SIGTERM : 0 ) == -1 ) {
+	if( kill( otherpid, kill_mthreads ? SIGTERM : 0 ) == -1
+	 && errno == ESRCH ) {
=	    if( unlink( filename ) == -1 ) {
=		fprintf( stderr, "unable to unlink lockfile %s\n", filename );
@@ -260,16 +271,22 @@
=    }
=
+#ifdef SIGHUP
=    if( sigset( SIGHUP, SIG_IGN ) != SIG_IGN ) {
-	sigset( SIGHUP, interrupt );
+	sigset( SIGHUP, int_handler );
=    }
+#endif
=    if( sigset( SIGINT, SIG_IGN ) != SIG_IGN ) {
-	sigset( SIGINT, interrupt );
+	sigset( SIGINT, int_handler );
=    }
+#ifdef SIGQUIT
=    if( sigset( SIGQUIT, SIG_IGN ) != SIG_IGN ) {
-	sigset( SIGQUIT, interrupt );
+	sigset( SIGQUIT, int_handler );
=    }
-    sigset( SIGTERM, interrupt );
-    sigset( SIGBUS, interrupt );
-    sigset( SIGSEGV, interrupt );
+#endif
+    sigset( SIGTERM, int_handler );
+#ifdef SIGBUS
+    sigset( SIGBUS, severe_handler );
+#endif
+    sigset( SIGSEGV, severe_handler );
=#ifdef SIGTTIN
=    sigset( SIGTTIN, SIG_IGN );
@@ -279,5 +296,6 @@
=#ifdef lint
=    alarm_handler();			/* foolishness for lint's sake */
-    interrupt( 14 );
+    int_handler( SIGINT );
+    severe_handler( SIGSEGV );
=#endif
=
@@ -284,5 +302,5 @@
=    /* Ensure this machine has the right byte-order for the database */
=    filename = file_exp( "%X/db.init" );
-    if( (fp_lock = fopen( filename, "r")) == Nullfp
+    if( (fp_lock = fopen( filename, FOPEN_RB )) == Nullfp
=     || fread( &mt_bmap, 1, sizeof (BMAP), fp_lock ) < sizeof (BMAP)-1 ) {
=	if( fp_lock != Nullfp ) {
@@ -291,5 +309,5 @@
=     write_db_init:
=	mybytemap( &mt_bmap );
-	if( (fp_lock = fopen( filename, "w" )) == Nullfp ) {
+	if( (fp_lock = fopen( filename, FOPEN_WB )) == Nullfp ) {
=	    log_entry( "Unable to create file: `%s'.\n", filename );
=	    exit( 1 );
@@ -388,5 +406,5 @@
=	for( ;; ) {
=	    if( caught_interrupt ) {
-		wrap_it_up();
+		wrap_it_up( 0 );
=		/* NORETURN */
=	    }
@@ -393,5 +411,5 @@
=	    pause();		/* let alarm go off */
=	    if( caught_interrupt ) {
-		wrap_it_up();
+		wrap_it_up( 0 );
=		/* NORETURN */
=	    }
@@ -400,5 +418,5 @@
=	    /* Re-open our log file, if needed */
=	    if( !fp_log && !(fp_log = fopen( file_exp( "%X/mt.log" ), "a" )) ) {
-		exit( 1 );
+		wrap_it_up( 1 );
=	    }
=#ifndef SERVER
@@ -405,5 +423,5 @@
=	    if( stat( file_exp( ACTIVE ), &filestat ) < 0 ) {
=		log_entry( "Unable to stat active file -- quitting.\n" );
-		exit( 1 );
+		wrap_it_up( 1 );
=	    }
=#endif
@@ -426,8 +444,8 @@
=    }/* if */
=
-    wrap_it_up();
+    wrap_it_up( 0 );
=}
=
-void
+SIGRET
=alarm_handler()
={
@@ -435,8 +453,12 @@
=}
=
-void
-interrupt( sig )
+SIGRET
+int_handler( sig )
=int sig;
={
+    /* Flag interrupt occurred -- main loop attempts an orderly retreat. */
+    if( ++caught_interrupt >= 3 ) {
+	wrap_it_up( 1 );
+    }
=    /* Re-open our log file, if needed */
=    if( fp_log || (fp_log = fopen( file_exp( "%X/mt.log" ), "a" )) ) {
@@ -444,5 +466,5 @@
=	    log_entry( "mthreads halted.\n", sig);
=	} else {
-	    log_entry( "** interrupt %d **\n", sig);
+	    log_entry( "Interrupt %d received.\n", sig);
=	}
=    }
@@ -450,14 +472,46 @@
=	printf( "interrupt %d!\n", sig );
=    }
-    /* Flag interrupt occurred -- main loop attempts an orderly retreat. */
-    caught_interrupt = TRUE;
+}
+
+/* Severe interrupts require severe action -- abort immediately, possibly
+** removing the thread file on the way.
+*/
+SIGRET
+severe_handler( sig )
+int sig;
+{
+    /* Let's be a bit paranoid here -- avoid any possibility of looping. */
+    if( caught_interrupt >= 10 ) {
+	wrap_it_up( 1 );
+    }
+    caught_interrupt = 10;
+
+    /* Destroy offending thread file if requested to do so. */
+    if( zap_thread ) {
+	unlink( thread_name( line ) );
+    }
+    /* Re-open our log file, if needed */
+    if( fp_log || (fp_log = fopen( file_exp( "%X/mt.log" ), "a" )) ) {
+	log_error( "** Severe signal: %s **\n", sig );
+	if( zap_thread ) {
+	    log_entry( "Destroyed thread file for %s\n", line );
+	}
+    }
+    if( !daemon_delay ) {
+	printf( "Severe signal: %s!\n", sig);
+	if( zap_thread ) {
+	    printf( "Destroyed thread file for %s\n", line );
+	}
+    }
+    wrap_it_up( 1 );
=}
=
=void
-wrap_it_up()
+wrap_it_up( ret )
+int ret;
={
=    unlink( file_exp( "%X/LOCKmthreads" ) );		/* remove lock */
=
-    exit( 0 );
+    exit( ret );
=}
=
@@ -483,5 +537,5 @@
=    case ERR_ACCESS:
=	log_entry( "Server %s rejected connection -- quitting.\n", server );
-	exit( 1 );
+	wrap_it_up( 1 );
=    default:
=	log_entry( "Couldn't connect with server %s -- sleeping.\n", server );
@@ -497,9 +551,9 @@
=    if( (fp_active = fopen( file_exp( ACTIVE1 ), "w+" )) == Nullfp ) {
=	log_entry( "Unable to write the active1 file.\n" );
-	exit( 1 );
+	wrap_it_up( 1 );
=    }
=    while( 1 ) {
=	if( caught_interrupt ) {
-	    wrap_it_up();
+	    wrap_it_up( 0 );
=	    /* NORETURN */
=	}
@@ -520,5 +574,5 @@
=    if( (fp_active = fopen( file_exp( ACTIVE ), "r" )) == Nullfp ) {
=	log_entry( "Unable to open the active file.\n" );
-	exit( 1 );
+	wrap_it_up( 1 );
=    }
=#endif
@@ -527,5 +581,5 @@
=	if( (fp_active3 = fopen( filename, "w" )) == Nullfp ) {
=	    log_entry( "Unable to open the active2 file for update.\n" );
-	    exit( 1 );
+	    wrap_it_up( 1 );
=	}
=    }
@@ -532,8 +586,8 @@
=    if( (fp_active2 = fopen( filename, "r" )) == Nullfp ) {
=	log_entry( "Unable to open the active2 file.\n" );
-	exit( 1 );
+	wrap_it_up( 1 );
=    }
=    if( caught_interrupt ) {
-	wrap_it_up();
+	wrap_it_up( 0 );
=	/* NORETURN */
=    }
@@ -564,4 +618,7 @@
=	    }
=	}
+	if( debug || log_verbosity > 3 ) {
+	    log_entry( "Processing %s:\n", line );
+	}
=	data_file_open = 0;
=	/* If we've allocated some lines in memory while searching for
@@ -605,10 +662,11 @@
=			ch2 = 'y';
=		    } else {
-			total.last = last2 = last;
=			total.first = first2 = first;
=			if( add_new ) {
+			    total.last = last2 = first - 1;
=			    ch2 = (ch == '=' ? 'x' : ch);
=			    added_groups++;
=			} else {
+			    total.last = last2 = last;
=			    ch2 = (ch == '=' ? 'X' : toupper( ch ));
=			}
@@ -677,5 +735,5 @@
=	case NG_MATCH:				/* add if unthreaded */
=	    if( ch2 < 'a' ) {
-		last2 = first2 - 1;
+		total.last = last2 = first2 - 1;
=		added_groups++;
=	    }
@@ -796,5 +854,5 @@
=		    update_successful = TRUE;
=		} else {
-		    strcpy( cp, ".new" );	/* write data as .new */
+		    strcpy( cp, NEW_THREAD );	/* write data as .new */
=		    if( write_data( line2 ) && !grevious_error ) {
=			rename( line2, filename );
@@ -826,4 +884,8 @@
=	    fprintf( fp_active3, fmt_active2, line, last2, first2, ch2 );
=	}
+	/* If we're not out of sync, keep active2 file flushed. */
+	if( !line_root ) {
+	    fflush( fp_active3 );
+	}
=    }/* for */
=
@@ -873,4 +935,5 @@
=#endif /* not XENIX */
=#endif /* not TRUNCATE */
+	truncate_len = -1;
=    }
=
@@ -1063,4 +1126,5 @@
={
=    time_t now;
+    char *ctime();
=
=    (void) time( &now );
Index: ndir.h
@@ -1,5 +1,8 @@
-/* $Header: ndir.h,v 4.3.2.1 90/04/17 15:28:13 sob Exp $
+/* $Header: ndir.h,v 4.3.3.1 91/01/16 03:18:04 davison Trn $
= *
= * $Log:	ndir.h,v $
+ * Revision 4.3.3.1  91/01/16  03:18:04  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3.2.1  90/04/17  15:28:13  sob
= * Altered to include correct directory include file.
@@ -52,10 +55,10 @@
=#define NULL 0
=#endif
-extern	DIR *opendir();
-extern	struct direct *readdir();
-extern	long telldir();
-extern	void seekdir();
+extern	DIR *opendir ANSI((char *));
+extern	struct direct *readdir ANSI((DIR *));
+extern	long telldir ANSI((DIR *));
+extern	void seekdir ANSI((DIR *));
=#define rewinddir(dirp)	seekdir((dirp), (long)0)
-extern	void closedir();
+extern	void closedir ANSI((DIR *));
=
=#   endif
Index: newsetup.SH
@@ -6,7 +6,13 @@
=$startsh
=
-# $Header: newsetup.SH,v 4.3.2.7 90/03/17 20:34:48 sob Exp $
+# $Header: newsetup.SH,v 4.3.3.1 91/01/16 03:18:11 davison Trn $
=# 
=# $Log:	newsetup.SH,v $
+# Revision 4.3.3.1  91/01/16  03:18:11  davison
+# Integrated rn patches 48-54.
+# 
+# Revision 4.3.2.8  90/11/22  13:26:55  sob
+# Purged unneeded code.
+# 
=# Revision 4.3.2.7  90/03/17  20:34:48  sob
=# Remove the /tmp/n.* files created when generating the .newsrc.
@@ -69,82 +75,4 @@
=#NORMALesac
=
-: NOTE: SED WILL NOT TAKE MORE THAN 9 WFILES, SO BEWARE   
-
-$sort <\$active | $sed >/tmp/n.tmp\$\$	\\
-	-e 's/^\([^ ]*\) .*\$/\1:/'	\\
-	-e '/^control:/{'		\\
- 	-e "  s/:/!/"	\\
-	-e "  w /tmp/n.test\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e '/^junk:/{'			\\
- 	-e "  s/:/!/"	\\
-	-e "  w /tmp/n.test\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e '/test:/{'			\\
- 	-e "  s/:/!/"	\\
-	-e "  w /tmp/n.test\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^\$locorg\./{"		\\
-	-e "  w /tmp/n.\$locorg\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^\$organization\./{"	\\
-	-e "  w /tmp/n.\$organization\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^\$city\./{"		\\
-	-e "  w /tmp/n.\$city\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^\$cntry\./{" 		\\
-	-e "  w /tmp/n.\$cntry\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^\$state\./{" 		\\
-	-e "  w /tmp/n.\$state\$\$"	\\
-	-e '  d'			\\
-	-e '}'
-
-$sed </tmp/n.tmp\$\$ >/tmp/n.local\$\$	\\
-	-e "/^\$cont\./{" 		\\
-	-e "  w /tmp/n.\$cont\$\$"	\\
-	-e '  d'			\\
-	-e '}'
-
-$sed </tmp/n.tmp\$\$ >/tmp/n.local\$\$	\\
-	-e "/^to\./{"			\\
-	-e "  s/:/!/"	\\
-	-e "  w /tmp/n.to\$\$"		\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^comp\./{"			\\
-	-e "  w /tmp/n.comp\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^news\./{"			\\
-	-e "  w /tmp/n.news\$\$"	\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^rec\./{"			\\
-	-e "  w /tmp/n.rec\$\$"		\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^sci\./{"			\\
-	-e "  w /tmp/n.sci\$\$"		\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/^soc\./{"			\\
-	-e "  w /tmp/n.soc\$\$"		\\
-	-e '  d'			\\
-	-e '}'				\\
-	-e "/\./{"			\\
-	-e "  w /tmp/n.misc\$\$"	\\
-	-e '  d'			\\
-	-e '}'
-
-
=if $test -s \$dotdir/.newsrc ; then
=    $echo "Saving your current .newsrc as .oldnewsrc..."
@@ -156,4 +84,5 @@
=$sed <\$active '
=	/^to\./d
+	/ [^mny][^ ]*$/d
=	s/ .*//
=	s/^/ /
Index: newsgroups.SH
@@ -5,7 +5,10 @@
=$spitshell >newsgroups <<!GROK!THIS!
=$startsh
-# $Header: newsgroups.SH,v 4.3.2.7 90/04/23 19:30:41 sob Exp $
+# $Header: newsgroups.SH,v 4.3.3.1 91/01/16 03:18:14 davison Trn $
=# 
=# $Log:	newsgroups.SH,v $
+# Revision 4.3.3.1  91/01/16  03:18:14  davison
+# Integrated rn patches 48-54.
+# 
=# Revision 4.3.2.7  90/04/23  19:30:41  sob
=# Extra space removed to make second part of newsgroups work.
Index: ng.c
@@ -1,5 +1,8 @@
-/* $Header: ng.c,v 4.3.3.2 90/08/20 16:03:45 davison Trn $
+/* $Header: ng.c,v 4.3.3.3 91/01/16 03:18:16 davison Trn $
= *
= * $Log:	ng.c,v $
+ * Revision 4.3.3.3  91/01/16  03:18:16  davison
+ * Integrated rn patches 48-54.  Fixed in_char/verify interaction.
+ * 
= * Revision 4.3.3.2  90/08/20  16:03:45  davison
= * Fixed bug in backpage code.
@@ -8,4 +11,10 @@
= * Initial Trn Release
= * 
+ * Revision 4.3.2.9  91/01/05  14:56:47  sob
+ * Removed bogus "fast skip" for NNTP.
+ *
+ * Revision 4.3.2.8  90/11/22  16:14:17  sob
+ * Added changes to accomodate picky C preprocessors
+ * 
= * Revision 4.3.2.7  90/04/21  14:44:23  sob
= * Revised previous patch insure that it does not decrement below zero.
@@ -148,5 +157,5 @@
=    char ser_line[256];
=    char artname[32];
-    static long our_pid;
+    static long our_pid=0;
=#endif /* SERVER */
=    char oldmode = mode;
@@ -382,4 +391,8 @@
=		printf("End of %s",ngname);
=#endif
+#ifdef USETHREADS
+	    if (ThreadedGroup)
+		ucount -= unthreaded;
+#endif
=	    if (ucount) {
=#ifdef USETHREADS
@@ -443,7 +456,5 @@
=		    fputs("Skipping",stdout);
=#endif
-		for (i = just_a_sec/3; i; --i)
-		    putchar(PC);
-		fflush(stdout);
+		pad(just_a_sec/3);
=		sleep(1);
=		break;
@@ -467,24 +478,5 @@
=		    art = newart - 1;
=		}
-#endif
-#else
-		{
-			char	ser_line[256];
-			ART_NUM	newart;
-
-			put_server("NEXT");
-			if (get_server(ser_line, sizeof (ser_line)) < 0) {
-				fprintf(stderr,
-			"rrn: unexpected close of server socket.\n");
-				finalize(1);
-			}
-			if (ser_line[0] != CHAR_OK)
-				newart = lastart + 1;
-			else
-				newart = atoi(ser_line+4);
-		        for (i=art; i<newart; i++)
-				oneless(i);
-		        art = newart - 1;
-		}
+#endif /* READDIR */
=#endif /* SERVER */
=		break;
@@ -737,5 +729,4 @@
=      reask_unread:
=	in_char(u_prompt,'u');
-	putchar('\n') FLUSH;
=	setdef(buf,dfltcmd);
=#ifdef VERIFY
@@ -742,4 +733,5 @@
=	printcmd();
=#endif
+	putchar('\n') FLUSH;
=	if (*buf == 'h') {
=	    fputs(u_help_thread,stdout);
@@ -1225,5 +1217,4 @@
=	    in_char("\nReally? [ynh] ", 'C');
=#endif
-	putchar('\n') FLUSH;
=	setdef(buf,"y");
=#ifdef VERIFY
@@ -1230,4 +1221,5 @@
=	printcmd();
=#endif
+	putchar('\n') FLUSH;
=	if (*buf == 'h') {
=#ifdef VERBOSE
Index: ng.h
@@ -1,5 +1,8 @@
-/* $Header: ng.h,v 4.3 85/05/01 11:44:29 lwall Exp $
+/* $Header: ng.h,v 4.3.3.1 91/01/16 03:18:20 davison Trn $
= *
= * $Log:	ng.h,v $
+ * Revision 4.3.3.1  91/01/16  03:18:20  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:44:29  lwall
= * Baseline for release with 4.3bsd.
@@ -28,9 +31,9 @@
=#define NG_MINUS 2
=
-void    ng_init();
-int	do_newsgroup();
-int	art_switch();
+void    ng_init ANSI((void));
+int	do_newsgroup ANSI((char *));
+int	art_switch ANSI((void));
=#ifdef MAILCALL
-    void	setmail();
+    void	setmail ANSI((void));
=#endif
-void	setdfltcmd();
+void	setdfltcmd ANSI((void));
Index: ngdata.c
@@ -1,8 +1,14 @@
-/* $Header: ngdata.c,v 4.3.3.1 90/07/21 20:28:27 davison Trn $
+/* $Header: ngdata.c,v 4.3.3.2 91/01/16 03:18:21 davison Trn $
= *
= * $Log:	ngdata.c,v $
+ * Revision 4.3.3.2  91/01/16  03:18:21  davison
+ * Integrated rn patches 48-54.  Fixed bug in ZEROGLOB code.
+ * 
= * Revision 4.3.3.1  90/07/21  20:28:27  davison
= * Initial Trn Release
= * 
+ * Revision 4.3.2.11  90/11/22  16:14:34  sob
+ * Added changes to accomodate picky C preprocessors
+ * 
= * Revision 4.3.2.10  90/04/14  22:05:15  sob
= * Removed redundant declaration of active_name
@@ -70,6 +76,9 @@
=#ifdef ZEROGLOB
=# ifdef CACHEFIRST
+  {
+    int i;
=    for (i=0; i<MAXRCLINE; i++)
=	abs1st[i] = 0;
+  }
=# endif
=#endif	/* ZEROGLOB */
Index: ngdata.h
@@ -1,5 +1,8 @@
-/* $Header: ngdata.h,v 4.3.3.1 90/06/20 22:38:50 davison Trn $
+/* $Header: ngdata.h,v 4.3.3.2 91/01/16 03:18:22 davison Trn $
= *
= * $Log:	ngdata.h,v $
+ * Revision 4.3.3.2  91/01/16  03:18:22  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3.3.1  90/06/20  22:38:50  davison
= * Initial Trn Release
@@ -37,7 +40,7 @@
=#endif
=
-void	ngdata_init();
-ART_NUM	getngsize();
-ACT_POS findact();
-ART_NUM	getabsfirst();
-ART_NUM	getngmin();
+void	ngdata_init ANSI((void));
+ART_NUM	getngsize ANSI((NG_NUM));
+ACT_POS findact ANSI((char *,char *,int,long));
+ART_NUM	getabsfirst ANSI((NG_NUM,ART_NUM));
+ART_NUM	getngmin ANSI((char *,ART_NUM));
Index: ngsrch.h
@@ -1,5 +1,8 @@
-/* $Header: ngsrch.h,v 4.3 85/05/01 11:44:56 lwall Exp $
+/* $Header: ngsrch.h,v 4.3.3.1 91/01/16 03:18:24 davison Trn $
= *
= * $Log:	ngsrch.h,v $
+ * Revision 4.3.3.1  91/01/16  03:18:24  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:44:56  lwall
= * Baseline for release with 4.3bsd.
@@ -16,10 +19,10 @@
=#endif
=
-void	ngsrch_init();
+void	ngsrch_init ANSI((void));
=#ifdef NGSEARCH 
-    int		ng_search();
-    bool	ng_wanted();
+    int		ng_search ANSI((char *,int));
+    bool	ng_wanted ANSI((void));
=#endif
=#ifdef NGSORONLY
-    char	*ng_comp();
+    char	*ng_comp ANSI((COMPEX *,char *,bool,bool));
=#endif
Index: ngstuff.c
@@ -1,5 +1,8 @@
-/* $Header: ngstuff.c,v 4.3.3.2 90/08/20 18:29:08 davison Trn $
+/* $Header: ngstuff.c,v 4.3.3.3 91/01/16 03:18:25 davison Trn $
= *
= * $Log:	ngstuff.c,v $
+ * Revision 4.3.3.3  91/01/16  03:18:25  davison
+ * Changed some expressions to registers to bypass a compiler problem.
+ * 
= * Revision 4.3.3.2  90/08/20  18:29:08  davison
= * Expanded path arrays for consistancy.
@@ -360,12 +363,14 @@
=#ifdef USETHREADS
=	else if (ch == '+') {
+	  register char mask = unread_selector+1;
=	    find_article(art);
-	    if (p_art && !(selected_roots[p_art->root] & (unread_selector+1))) {
-		selected_roots[p_art->root] |= (unread_selector+1);
+	    if (p_art && !(selected_roots[p_art->root] & mask)) {
+	      register int r = p_art->root;
+		selected_roots[r] |= mask;
=		selected_root_cnt++;
=		if (mode == 't') {
-		    selected_count += root_article_cnts[p_art->root];
+		    selected_count += root_article_cnts[r];
=		} else {
-		    selected_count += count_one_root(p_art->root);
+		    selected_count += count_one_root(r);
=#ifdef VERBOSE
=		    IF(verbose)
@@ -376,13 +381,15 @@
=	}
=	else if (ch == '-') {
+	  register char mask = unread_selector+1;
=	    find_article(art);
=	    if (p_art && selected_root_cnt
-	     && (selected_roots[p_art->root] & (unread_selector+1))) {
-		selected_roots[p_art->root] &= ~(unread_selector+1);
+	     && (selected_roots[p_art->root] & mask)) {
+	      register int r = p_art->root;
+		selected_roots[r] &= ~mask;
=		selected_root_cnt--;
=		if (mode == 't') {
-		    selected_count -= root_article_cnts[p_art->root];
+		    selected_count -= root_article_cnts[r];
=		} else {
-		    selected_count -= count_one_root(p_art->root);
+		    selected_count -= count_one_root(r);
=#ifdef VERBOSE
=		    IF(verbose)
Index: ngstuff.h
@@ -1,5 +1,8 @@
-/* $Header: ngstuff.h,v 4.3.3.1 90/06/20 22:39:07 davison Trn $
+/* $Header: ngstuff.h,v 4.3.3.2 91/01/16 03:18:27 davison Trn $
= *
= * $Log:	ngstuff.h,v $
+ * Revision 4.3.3.2  91/01/16  03:18:27  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3.3.1  90/06/20  22:39:07  davison
= * Initial Trn Release
@@ -17,7 +20,10 @@
=EXT bool one_command INIT(FALSE);	/* no ':' processing in perform() */
=
-void	ngstuff_init();
-int	escapade();
-int	switcheroo();
-int	numnum();
-int	perform();
+void	ngstuff_init ANSI((void));
+int	escapade ANSI((void));
+int	switcheroo ANSI((void));
+int	numnum ANSI((void));
+int	perform ANSI((char *,int));
+#ifdef USETHREADS
+int	use_selected ANSI((void));
+#endif
Index: norm.saver.SH
@@ -5,7 +5,10 @@
=$spitshell >norm.saver <<!GROK!THIS!
=$startsh
-# $Header: norm.saver.SH,v 4.3.2.1 89/11/28 00:08:01 sob Locked $
+# $Header: norm.saver.SH,v 4.3.2.2 90/11/22 15:44:06 sob Exp $
=# 
=# $Log:	norm.saver.SH,v $
+# Revision 4.3.2.2  90/11/22  15:44:06  sob
+# Changed . config.sh to . ./config.sh
+# 
=# Revision 4.3.2.1  89/11/28  00:08:01  sob
=# Branch for RN/RRN combo.
Index: only.c
@@ -1,7 +1,13 @@
-/* $Header: only.c,v 4.3.3.1 90/06/20 22:39:13 davison Trn $
+/* $Header: only.c,v 4.3.3.2 91/01/16 03:26:16 davison Trn $
= *
= * $Log:	only.c,v $
+ * Revision 4.3.3.2  91/01/16  03:26:16  davison
+ * Integrated rn patches 48-54.
+ * 
= * Revision 4.3.3.1  90/06/20  22:39:13  davison
= * Initial Trn Release
+ * 
+ * Revision 4.3.2.1  90/11/22  16:11:20  sob
+ * Added changes to accomodate pickly C preprocessors.
= * 
= * Revision 4.3  85/05/01  11:45:21  lwall
Index: only.h
@@ -1,5 +1,8 @@
-/* $Header: only.h,v 4.3 85/05/01 11:45:27 lwall Exp $
+/* $Header: only.h,v 4.3.3.1 91/01/16 03:26:16 davison Trn $
= *
= * $Log:	only.h,v $
+ * Revision 4.3.3.1  91/01/16  03:26:16  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:45:27  lwall
= * Baseline for release with 4.3bsd.
@@ -21,9 +24,9 @@
=					/* >0 => # of entries in ngtodo */
=
-void	only_init();
-bool	inlist();	/* return TRUE if ngname is in command line list */
+void	only_init ANSI((void));
+bool	inlist ANSI((char *));	/* return TRUE if ngname is in command line list */
=			/* or if there was no list */
-void	setngtodo();
+void	setngtodo ANSI((char *));
=#ifdef ONLY
-    void	end_only();
+    void	end_only ANSI((void));
=#endif
Index: Pnews.SH
@@ -5,7 +5,10 @@
=$spitshell >Pnews <<!GROK!THIS!
=$startsh
-# $Header: Pnews.SH,v 4.3.3.2 90/08/20 16:24:09 davison Trn $
+# $Header: Pnews.SH,v 4.3.3.3 91/01/16 03:27:15 davison Trn $
=#
=# $Log:	Pnews.SH,v $
+# Revision 4.3.3.3  91/01/16  03:27:15  davison
+# Integrated rn patches 48-54.
+# 
=# Revision 4.3.3.2  90/08/20  16:24:09  davison
=# Use mbox.saver for AUTHORCOPY.  Fixed sitename handling.
@@ -14,4 +17,28 @@
=# Initial Trn Release
=# 
+# Revision 4.3.2.14  91/01/05  15:18:19  sob
+# Changed the header purge code to use sed instead of grep.
+# 
+# Revision 4.3.2.13  90/12/30  03:47:57  sob
+# Changed "hidden" to "hiddennet" to be like nntp and bnews.
+# Made it possible to cancel articles if hiddennet is defined.
+# 
+# Revision 4.3.2.12  90/12/30  03:27:44  sob
+# Corrected a spelling problem.
+# 
+# Revision 4.3.2.11  90/12/04  02:47:54  sob
+# Added a fix to remove blank lines in the header before posting.
+# 
+# Revision 4.3.2.10  90/11/22  13:45:40  sob
+# Added support for making news posting appear to come from the domain
+# itself instead of individual hosts withing a domain.
+# 
+# Revision 4.3.2.9  90/11/06  00:54:52  sob
+# Added ./ to be beginning of config.sh
+# 
+# Revision 4.3.2.8  90/11/06  00:08:11  sob
+# Fixed bug in sed syntax for usg password file format per bug report by
+# prc at erbe.se
+# 
=# Revision 4.3.2.7  90/05/04  23:14:45  sob
=# Expires: line removed from Pnews.header.
@@ -94,4 +121,11 @@
=esac
=
+case $hiddennet in
+define)	sitename="$domain"
+	;;
+*)
+	;;
+esac
+
=# your organization name
=orgname="$orgname"
@@ -126,4 +160,5 @@
=tr=${tr-tr}
=inews=${inews-inews}
+nidump=${nidump}
=ypmatch=${ypmatch}
=
@@ -240,5 +275,5 @@
=shift
=if $test $# -gt 0 ; then
-    dist=$1
+    dist=$1.whatever
=else
=    set X $hdr_newsgroups
@@ -245,5 +280,5 @@
=    shift
=    if $test $# -gt 0 ; then
-	dist=$1
+	dist=$1.whatever
=    else
=	dist=misc.whatever
@@ -250,4 +285,11 @@
=    fi
=fi
+case $dist in
+*.*)
+    ;;
+*)
+    dist=$dist.whatever
+    ;;
+esac
=
=# tell them what we think they are doing... !DIST!
@@ -292,5 +334,5 @@
=    ;;
=to.*)
-    $echo 'This program may post news to a partcular machine.'
+    $echo 'This program may post news to a particular machine.'
=    ;;
=*)
@@ -495,5 +537,6 @@
=	    case "$tryinews" in
=	    yes)
-		if $inews -h < $tmpart ; then
+		if $sed '1,/^[	 ]*$/{/^[A-Z][-A-Za-z0-9]*:[	 ]*$/d;}' $tmpart |
+			$inews -h ; then
=		    : null
=		else
@@ -693,10 +736,12 @@
=case ${NAME-$nametype} in
=bsd)
- 	if $test "$ypmatch" != ""; then
- 		fullname=`$ypmatch $logname passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/"`
- 	fi
+	if $test "$ypmatch" != ""; then
+		fullname=`$ypmatch $logname passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/"`
+	elif $test "$nidump" != ""; then
+		fullname=`$nidump passwd / | $sed -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
+	fi
=     if $test "$fullname" = ""; then
- 		fullname=`$sed </etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
- 	fi
+		fullname=`$sed </etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^,:;]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
+	fi
=    case $fullname in
=    *'&'*) : GACK
@@ -708,10 +753,10 @@
=    ;;
=usg)
- 	if $test "$ypmatch" != ""; then
- 		fullname=`$ypmatch $logname passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^(:]*\).*"'$'"/\1/" -e "s/^.*-//" -e "q"`
- 	fi
+	if $test "$ypmatch" != ""; then
+		fullname=`$ypmatch $logname passwd 2>/dev/null | $sed -e "s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^(:]*\).*"'$'"/\1/" -e "s/^.*-//" -e "q"`
+	fi
=     if $test "$fullname" = ""; then
=    fullname=`$sed </etc/passwd -e "/^$logname:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:\([^(:]*\).*"'$'"/\1/" -e "s/^.*-//" -e "q" -e "}" -e "d"`
- 	fi
+	fi
=    ;;
=*)
@@ -728,4 +773,5 @@
=Newsgroups: $ng
=Subject: $title
+Summary: 
=Reply-To: $REPLYTO
=Followup-To: $follow
Index: rcln.h
@@ -1,5 +1,8 @@
-/* $Header: rcln.h,v 4.3.3.1 90/08/20 16:47:22 davison Trn $
+/* $Header: rcln.h,v 4.3.3.2 91/01/16 03:28:33 davison Trn $
= *
= * $Log:	rcln.h,v $
+ * Revision 4.3.3.2  91/01/16  03:28:33  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3.3.1  90/08/20  16:47:22  davison
= * Removed ngmax array.
@@ -14,13 +17,13 @@
=#endif
=
-void    rcln_init();
+void    rcln_init ANSI((void));
=#ifdef CATCHUP
-    void	catch_up();
+    void	catch_up ANSI((NG_NUM));
=#endif
-int	addartnum();
+int	addartnum ANSI((ART_NUM,char *));
=#ifdef MCHASE
-    void	subartnum();
+    void	subartnum ANSI((ART_NUM,char *));
=#endif
-void	prange();
-void	set_toread();
-void	checkexpired();
+void	prange ANSI((char *,ART_NUM,ART_NUM));
+void	set_toread ANSI((NG_NUM));
+void	checkexpired ANSI((NG_NUM,ART_NUM));
Index: rcstuff.c
@@ -1,5 +1,8 @@
-/* $Header: rcstuff.c,v 4.3.3.2 90/08/20 16:47:44 davison Trn $
+/* $Header: rcstuff.c,v 4.3.3.3 91/01/16 03:28:34 davison Trn $
= *
= * $Log:	rcstuff.c,v $
+ * Revision 4.3.3.3  91/01/16  03:28:34  davison
+ * Integrated rn patches 48-54.  Fixed in_char and verify interaction.
+ * 
= * Revision 4.3.3.2  90/08/20  16:47:44  davison
= * Removed ngmax array.
@@ -8,4 +11,27 @@
= * Initial Trn Release
= * 
+ * Revision 4.3.2.12  90/12/12  03:05:15  sob
+ * Adds "N" command to compliment the "Y" command when prompted for adding
+ * new newsgroups.
+ * 
+ * Revision 4.3.2.11  90/11/22  17:49:57  sob
+ * Fixed "Y" for regular rn users (non-NNTP).
+ * 
+ * Revision 4.3.2.10  90/11/22  13:53:26  sob
+ * Made changes to keep more preprocessors happy.
+ * 
+ * Revision 4.3.2.9  90/11/06  01:04:39  sob
+ * Updated help messages to include new Y command when adding new newsgroups.
+ * 
+ * Revision 4.3.2.8  90/10/30  23:26:43  sob
+ * Changes to restore .newsrc when exiting rn and diskspace runs out while
+ * updating .newsrc.
+ * 
+ * Revision 4.3.2.7  90/10/30  22:47:49  sob
+ * A bit of cleanup.
+ * 
+ * Revision 4.3.2.6  90/09/04  23:36:32  sob
+ * Changed "add" to "subscribe" to actually reflect what is being done.
+ * 
= * Revision 4.3.2.5  90/05/04  00:44:07  sob
= * Fixes to add_newsgroup() from lar at usl.edu.
@@ -266,7 +292,8 @@
=/* assumes that we are chdir'ed to SPOOL */
=
-#ifdef SERVER
+#define ADDNEW_SUB 1
+#define ADDNEW_UNSUB 2
+
=static int addnewbydefault = 0;
-#endif /* SERVER */
=
=bool
@@ -328,22 +355,23 @@
=	    return FALSE;
=	}
-#ifdef SERVER
=	if (addnewbydefault) {
-		printf("(Adding %s to end of your .newsrc)\n", ngname);
-	        ng = add_newsgroup(ngname, ':');
+		printf("(Adding %s to end of your .newsrc %ssubscribed)\n",
+		       ngname, (addnewbydefault == ADDNEW_SUB) ? "" : "un");
+		if (addnewbydefault == ADDNEW_SUB)
+		     ng = add_newsgroup(ngname, ':');
+		else
+		     ng = add_newsgroup(ngname, '!');
=	        do_reloc = FALSE;
=	} else {
-#endif /* SERVER */
=#ifdef VERBOSE
=	IF(verbose)
-	    sprintf(promptbuf,"\nNewsgroup %s not in .newsrc--add? [yn] ",ngname);
+	    sprintf(promptbuf,"\nNewsgroup %s not in .newsrc--subscribe? [ynYN] ",ngname);
=	ELSE
=#endif
=#ifdef TERSE
-	    sprintf(promptbuf,"\nAdd %s? [yn] ",ngname);
+	    sprintf(promptbuf,"\nSubscribe %s? [ynY] ",ngname);
=#endif
=reask_add:
=	in_char(promptbuf,'A');
-	putchar('\n') FLUSH;
=	setdef(buf,"y");
=#ifdef VERIFY
@@ -350,8 +378,9 @@
=	printcmd();
=#endif
+	putchar('\n') FLUSH;
=	if (*buf == 'h') {
=#ifdef VERBOSE
=	    IF(verbose)
-		printf("Type y or SP to add %s to your .newsrc.\n", ngname)
+		printf("Type y or SP to add %s to your .newsrc.\nType Y to add all new groups to the end of your .newsrc.\nType N to add all new groups to the end of your .newsrc unsubscribed.\n", ngname)
=		  FLUSH;
=	    ELSE
@@ -358,5 +387,5 @@
=#endif
=#ifdef TERSE
-		fputs("y or SP to add\n",stdout) FLUSH;
+		fputs("y or SP to add, Y to add all new groups, N to add all new groups unsubscribed\n",stdout) FLUSH;
=#endif
=	    fputs(ntoforget,stdout) FLUSH;
@@ -371,14 +400,22 @@
=	    do_reloc = FALSE;
=	}
-#ifdef SERVER
=	else if (*buf == 'Y') {
=	    fputs(
-	"(I'll add all new newsgroups to the end of your .newsrc.)\n", stdout);
-	    addnewbydefault = 1;
-	    printf("(Adding %s to end of your .newsrc)\n", ngname);
+    "(I'll add all new newsgroups (subscribed) to the end of your .newsrc.)\n",
+		  stdout);
+	    addnewbydefault = ADDNEW_SUB;
+	    printf("(Adding %s to end of your .newsrc subscribed)\n", ngname);
=	    ng = add_newsgroup(ngname, ':');
=	    do_reloc = FALSE;
=	}
-#endif /* SERVER */
+	else if (*buf == 'N') {
+	    fputs(
+  "(I'll add all new newsgroups (unsubscribed) to the end of your .newsrc.)\n",
+		  stdout);
+	    addnewbydefault = ADDNEW_UNSUB;
+	    printf("(Adding %s to end of your .newsrc unsubscribed)\n", ngname);
+	    ng = add_newsgroup(ngname, '!');
+	    do_reloc = FALSE;
+	}
=	else {
=	    fputs(hforhelp,stdout) FLUSH;
@@ -386,7 +423,5 @@
=	    goto reask_add;
=	}
-#ifdef SERVER
=      }
-#endif /* SERVER */
=    }
=    else if (rcchar[ng] == NEGCHAR) {	/* unsubscribed? */
@@ -404,5 +439,4 @@
=reask_unsub:
=	in_char(promptbuf,'R');
-	putchar('\n') FLUSH;
=	setdef(buf,"y");
=#ifdef VERIFY
@@ -409,4 +443,5 @@
=	printcmd();
=#endif
+	putchar('\n') FLUSH;
=	if (*buf == 'h') {
=#ifdef VERBOSE
@@ -541,5 +576,4 @@
=      reask_reloc:
=	unflush_output();		/* disable any ^O in effect */
-#ifdef SERVER
=	if (addnewbydefault) {
=	    buf[0] = '$';
@@ -546,5 +580,4 @@
=	    buf[1] = '\0';
=	} else {
-#endif /* SERVER */
=#ifdef VERBOSE
=	IF(verbose)
@@ -559,7 +592,5 @@
=	eat_typeahead();
=	getcmd(buf);
-#ifdef SERVER
=	}
-#endif /* SERVER */
=	if (errno || *buf == '\f') {
=			    /* if return from stop signal */
@@ -623,5 +654,5 @@
=	}
=	else if (*buf == '$') {
-	    putchar('\n') FLUSH;
+	    if (! addnewbydefault) putchar('\n') FLUSH;
=	    return nextrcline-1;
=	}
@@ -811,5 +842,4 @@
=reask_bogus:
=	in_char("Delete bogus newsgroups? [ny] ", 'D');
-	putchar('\n') FLUSH;
=	setdef(buf,"n");
=#ifdef VERIFY
@@ -816,4 +846,5 @@
=	printcmd();
=#endif
+	putchar('\n') FLUSH;
=	if (*buf == 'h') {
=#ifdef VERBOSE
@@ -924,6 +955,5 @@
=#ifdef VERBOSE
=	IF(verbose)
-	    fputs("\
-Trying to set up a .newsrc file--running newsetup...\n\n\
+	    fputs("\nTrying to set up a .newsrc file--running newsetup...\n\n\
=",stdout) FLUSH;
=	ELSE
@@ -936,6 +966,5 @@
=#ifdef VERBOSE
=	    IF(verbose)
-		fputs("\
-Can't create a .newsrc--you must do it yourself.\n\
+		fputs("\nCan't create a .newsrc--you must do it yourself.\n\
=",stdout) FLUSH;
=	    ELSE
@@ -980,5 +1009,12 @@
=	    printf("%s\n",rcline[tmpng]) FLUSH;
=#endif
-	fprintf(rcfp,"%s\n",rcline[tmpng]);
+	if (fprintf(rcfp,"%s\n",rcline[tmpng]) < 0){
+			printf("Can't recreate .newsrc\n") FLUSH;
+			fclose(rcfp);			/* close .newsrc */
+			UNLINK(rctname);
+			finalize(1);
+    		}
+
+			;
=	if (delim)
=	    *delim = '\0';		/* might still need this line */
@@ -1007,4 +1043,8 @@
={
=    UNLINK(rctname);
+#ifdef RENAME
+    rename(rcname,rctname);
+    rename(rcbname,rcname);
+#else
=    link(rcname,rctname);
=    UNLINK(rcname);
@@ -1011,3 +1051,4 @@
=    link(rcbname,rcname);
=    UNLINK(rcbname);
+#endif
=}
Index: rcstuff.h
@@ -1,5 +1,8 @@
-/* $Header: rcstuff.h,v 4.3 85/05/01 11:46:49 lwall Exp $
+/* $Header: rcstuff.h,v 4.3.3.1 91/01/16 03:28:37 davison Trn $
= *
= * $Log:	rcstuff.h,v $
+ * Revision 4.3.3.1  91/01/16  03:28:37  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:46:49  lwall
= * Baseline for release with 4.3bsd.
@@ -24,16 +27,16 @@
=EXT bool paranoid INIT(FALSE);	/* did we detect some inconsistency in .newsrc? */
=
-bool	rcstuff_init();
-bool	get_ng();	/* return TRUE if newsgroup can be found or added */
-NG_NUM	add_newsgroup();
+bool	rcstuff_init ANSI((void));
+bool	get_ng ANSI((char *,bool));	/* return TRUE if newsgroup can be found or added */
+NG_NUM	add_newsgroup ANSI((char *,char));
=#ifdef RELOCATE
-    NG_NUM	relocate_newsgroup();	/* move newsgroup around */
+    NG_NUM	relocate_newsgroup ANSI((NG_NUM,NG_NUM));/* move newsgroup around */
=#endif
-void	list_newsgroups();
-NG_NUM	find_ng();	/* return index of newsgroup */
-void	cleanup_rc();
-void	sethash();
-int	hash();
-void	newsrc_check();
-void	write_rc();
-void	get_old_rc();
+void	list_newsgroups ANSI((void));
+NG_NUM	find_ng ANSI((char *));	/* return index of newsgroup */
+void	cleanup_rc ANSI((void));
+void	sethash ANSI((NG_NUM));
+int	hash ANSI((char *));
+void	newsrc_check ANSI((void));
+void	write_rc ANSI((void));
+void	get_old_rc ANSI((void));
Index: respond.c
@@ -1,8 +1,14 @@
-/* $Header: respond.c,v 4.3.3.1 90/07/21 20:30:18 davison Trn $
+/* $Header: respond.c,v 4.3.3.2 91/01/16 03:28:40 davison Trn $
= *
= * $Log:	respond.c,v $
+ * Revision 4.3.3.2  91/01/16  03:28:40  davison
+ * Integrated rn patches 48-54.  Changed fseek to allow for NL_SIZE.
+ * 
= * Revision 4.3.3.1  90/07/21  20:30:18  davison
= * Initial Trn Release
= * 
+ * Revision 4.3.2.4  90/11/22  16:09:04  sob
+ * Added changes to accomodate pickly C preprocessors
+ * 
= * Revision 4.3.2.3  90/03/22  23:05:19  sob
= * Fixes provided by Wayne Davison <drivax!davison>
@@ -166,5 +172,5 @@
=		 || strnEQ(art_buf, "cat ", 4)
=		 || strnEQ(art_buf, "echo ", 5)) {
-		    fseek(artfp,(long)-strlen(art_buf),1);
+		    fseek(artfp,(long)-strlen(art_buf)-NL_SIZE+1,1);
=		    savefrom = ftell(artfp);
=		    if (cmdstr) {
@@ -202,5 +208,5 @@
=		    extractprog = savestr("-");
=		    cnt = 0;
-		    fseek(artfp,(long)-strlen(art_buf),1);
+		    fseek(artfp,(long)-strlen(art_buf)-NL_SIZE+1,1);
=		    savefrom = ftell(artfp);
=		    uud_start(s);
Index: respond.h
@@ -1,5 +1,8 @@
-/* $Header: respond.h,v 4.3.3.1 90/06/20 22:39:54 davison Trn $
+/* $Header: respond.h,v 4.3.3.2 91/01/16 03:28:41 davison Trn $
= *
= * $Log:	respond.h,v $
+ * Revision 4.3.3.2  91/01/16  03:28:41  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3.3.1  90/06/20  22:39:54  davison
= * Initial Trn Release
@@ -18,8 +21,8 @@
=#define SAVE_DONE 1
=
-void	respond_init();
-int	save_article();
-int	cancel_article();
-void	reply();
-void	followup();
-void	invoke();
+void	respond_init ANSI((void));
+int	save_article ANSI((void));
+int	cancel_article ANSI((void));
+void	reply ANSI((void));
+void	followup ANSI((void));
+void	invoke ANSI((char *,char *));
Index: rn.h
@@ -1,5 +1,8 @@
-/* $Header: rn.h,v 4.3 85/05/01 11:48:19 lwall Exp $
+/* $Header: rn.h,v 4.3.3.1 91/01/16 03:28:44 davison Trn $
= *
= * $Log:	rn.h,v $
+ * Revision 4.3.3.1  91/01/16  03:28:44  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:48:19  lwall
= * Baseline for release with 4.3bsd.
@@ -17,6 +20,6 @@
=EXT char *spool INIT(Nullch);		/* public news spool directory */
=
-void	rn_init();
-void	main();
-void	set_ngname();
-char	*getngdir();
+void	rn_init ANSI((void));
+void	main ANSI((int,char **));
+void	set_ngname ANSI((char *));
+char	*getngdir ANSI((char *));
Index: Rnmail.SH
@@ -5,7 +5,10 @@
=$spitshell >Rnmail <<!GROK!THIS!
=$startsh
-# $Header: Rnmail.SH,v 4.3.3.2 90/08/20 16:22:29 davison Trn $
+# $Header: Rnmail.SH,v 4.3.3.3 91/01/16 03:28:46 davison Trn $
=# 
=# $Log:	Rnmail.SH,v $
+# Revision 4.3.3.3  91/01/16  03:28:46  davison
+# Integrated rn patches 48-54.
+# 
=# Revision 4.3.3.2  90/08/20  16:22:29  davison
=# Use mbox.saver for MAILRECORD.  Fixed sitename handling.
@@ -14,4 +17,12 @@
=# Initial Trn Release
=# 
+# Revision 4.3.2.3  90/12/30  03:48:04  sob
+# Changed "hidden" to "hiddennet" to be like nntp and bnews.
+# Made it possible to cancel articles if hiddennet is defined.
+# 
+# Revision 4.3.2.2  90/11/22  14:00:21  sob
+# Support added for hiding all hosts within a domain such that mail appears
+# to come for user at domainname only.
+# 
=# Revision 4.3.2.1  89/11/06  00:30:54  sob
=# Added RRN support from NNTP 1.5
@@ -61,4 +72,12 @@
=undef) sitename="$sitename" ;;
=esac
+
+case $hiddennet in
+define)	sitename="$domain"
+	;;
+*)
+	;;
+esac
+
=# your organization name
=orgname="$orgname"
@@ -69,4 +88,6 @@
=# default editor
=defeditor="$defeditor"
+# where the non-publics are
+rnlib=$rnlib
=# how not to do a newline with echo
=n="$n"
@@ -271,9 +292,9 @@
=    send)
=	if $test -f $dotdir/.signature; then
-	    echo $n "Append .signature file? [y] $c"
+	    $echo $n "Append .signature file? [y] $c"
=	    read ans
=	    case $ans in
=	    ''|y*)
-		echo "-- " >> $tmpart
+		$echo "-- " >> $tmpart
=		cat $dotdir/.signature >> $tmpart
=		;;
Index: rt-select.c
@@ -1,5 +1,9 @@
-/* $Header: rt-select.c,v 4.3.3.2 90/08/20 18:32:33 davison Trn $
+/* $Header: rt-select.c,v 4.3.3.3 91/01/16 03:28:50 davison Trn $
=**
=** $Log:	rt-select.c,v $
+** Revision 4.3.3.3  91/01/16  03:28:50  davison
+** Changed %d --> %ld.
+** Changed some expressions to registers to bypass a compiler problem.
+** 
=** Revision 4.3.3.2  90/08/20  18:32:33  davison
=** Reset scan_all_roots while selecting.
@@ -280,7 +284,8 @@
=	strcpy( promptbuf, "-- Select threads -- " );
=	if( i != max_root ) {
-	    sprintf( promptbuf+21, "%s%d%% [%c%c] --",
+	    sprintf( promptbuf+21, "%s%ld%% [%c%c] --",
=		(!page_root? "Top " : nullstr),
-		running_total*100 / article_count, page_char, end_char );
+		(long)(running_total*100 / article_count),
+		page_char, end_char );
=	} else {
=	    sprintf( promptbuf+21, "%s [%c%c] --",
@@ -423,4 +428,7 @@
=		}
=		do {
+		  register int r;
+		  register char maskr = mask;
+		    r = root_hold[cur_root];
=		    if( can_home ) {
=			goto_line( screen_line, root_line[cur_root] );
@@ -429,5 +437,5 @@
=		    putchar( select_chars[cur_root] );
=		    if( action == '@' ) {
-			if( selected_roots[root_hold[cur_root]] & 4 ) {
+			if( selected_roots[r] & 4 ) {
=			    ch = (unread_selector ? '+' : ' ');
=			} else if( unread_selector ) {
@@ -434,5 +442,5 @@
=			    ch = 'k';
=			} else
-			if( selected_roots[root_hold[cur_root]] & mask ) {
+			if( selected_roots[r] & maskr ) {
=			    ch = '-';
=			} else {
@@ -444,9 +452,8 @@
=		    switch( ch ) {
=		    case '+':
-			if( !(selected_roots[root_hold[cur_root]] & mask) ) {
-			    selected_roots[root_hold[cur_root]] |= mask;
+			if( !(selected_roots[r] & maskr) ) {
+			    selected_roots[r] |= maskr;
=			    selected_root_cnt++;
-			    selected_count
-				+= root_article_cnts[root_hold[cur_root]];
+			    selected_count += root_article_cnts[r];
=			    putchar( '+' );
=			}
@@ -453,6 +460,6 @@
=			/* FALL THROUGH */
=		    case 'm':
-			if( selected_roots[root_hold[cur_root]] & 4 ) {
-			    selected_roots[root_hold[cur_root]] &= ~4;
+			if( selected_roots[r] & 4 ) {
+			    selected_roots[r] &= ~4;
=			    if( ch == 'm' ) {
=				putchar( ' ' );
@@ -463,6 +470,6 @@
=			break;
=		    case 'k':
-			if( !(selected_roots[root_hold[cur_root]] & 4) ) {
-			    selected_roots[root_hold[cur_root]] |= 4;
+			if( !(selected_roots[r] & 4) ) {
+			    selected_roots[r] |= 4;
=			    putchar( '-' );
=			}
@@ -470,9 +477,8 @@
=		    case '-':
=		    unsel:
-			if( selected_roots[root_hold[cur_root]] & mask ) {
-			    selected_roots[root_hold[cur_root]] &= ~mask;
+			if( selected_roots[r] & maskr ) {
+			    selected_roots[r] &= ~maskr;
=			    selected_root_cnt--;
-			    selected_count
-				-= root_article_cnts[root_hold[cur_root]];
+			    selected_count -= root_article_cnts[r];
=			    if( ch != 'k' ) {
=				putchar( ' ' );
@@ -662,7 +668,8 @@
=	} else if( ch == '\r' || ch == '\n' ) {
=	    if( !selected_root_cnt ) {
-		selected_roots[root_hold[cur_root]] = mask;
+	      register r = root_hold[cur_root];
+		selected_roots[r] = mask;
=		selected_root_cnt++;
-		selected_count += root_article_cnts[root_hold[cur_root]];
+		selected_count += root_article_cnts[r];
=	    }
=	}
@@ -880,5 +887,6 @@
=	}
=	if( ++artp == root_limit ) {
-	    int root_num = artp[-1].root;
+	    register int root_num = artp[-1].root;
+	    register char maskr = mask;
=
=	    root_article_cnts[root_num] = count;
@@ -885,5 +893,5 @@
=	    if( count ) {
=		article_count += count;
-		if( selected_roots[root_num] & mask ) {
+		if( selected_roots[root_num] & maskr ) {
=		    selected_roots[root_num] &= ~4;
=		    selected_root_cnt++;
@@ -892,6 +900,6 @@
=		last_root = root_num;
=	    } else if( do_unselect ) {
-		selected_roots[root_num] &= ~mask;
-	    } else if( selected_roots[root_num] & mask ) {
+		selected_roots[root_num] &= ~maskr;
+	    } else if( selected_roots[root_num] & maskr ) {
=		selected_roots[root_num] &= ~4;
=		selected_root_cnt++;
Index: rthreads.c
@@ -1,5 +1,8 @@
-/* $Header: rthreads.c,v 4.3.3.2 90/08/20 16:58:14 davison Trn $
+/* $Header: rthreads.c,v 4.3.3.3 91/01/16 03:28:53 davison Trn $
=**
=** $Log:	rthreads.c,v $
+** Revision 4.3.3.3  91/01/16  03:28:53  davison
+** Changed Free to safefree.  Tweaked fopen for possible binary open mode.
+** 
=** Revision 4.3.3.2  90/08/20  16:58:14  davison
=** Added message for missing/bad db.init file.
@@ -24,5 +27,5 @@
=static int read_item();
=static void wp_bmap(), lp_bmap();
-static void Free();
+static void safefree();
=
=/* Initialize our thread code by determining the byte-order of the thread
@@ -38,5 +41,5 @@
=    word_same = long_same = TRUE;
=    filename = filexp( "%X/db.init" );
-    if( (fp_in = fopen( filename, "r" )) != Nullfp ) {
+    if( (fp_in = fopen( filename, FOPEN_RB )) != Nullfp ) {
=	if( fread( &mt_bmap, 1, sizeof (BMAP), fp_in ) >= sizeof (BMAP)-1 ) {
=	    if( mt_bmap.version != DB_VERSION ) {
@@ -77,5 +80,5 @@
=    register char *ptr;
=
-    if( (fp_in = fopen( threadname, "r" )) == Nullfp ) {
+    if( (fp_in = fopen( threadname, FOPEN_RB )) == Nullfp ) {
=	if (errno != ENOENT) {
=	    printf( "\n\nOpen failed for thread data -- continuing unthreaded.\n" );
@@ -151,5 +154,5 @@
=    }
=    count_roots( !saved_selections );
-    Free( &saved_selections );
+    safefree( &saved_selections );
=    select_page = 0;
=    return 1;
@@ -178,5 +181,5 @@
=*/
=static void
-Free( pp )
+safefree( pp )
=char **pp;
={
@@ -213,14 +216,14 @@
=	selected_root_cnt = selected_count = 0;
=    }
-    Free( &p_roots );
-    Free( &root_subjects );
-    Free( &author_cnts );
-    Free( &subject_cnts );
-    Free( &author_ptrs );
-    Free( &subject_ptrs );
-    Free( &root_article_cnts );
-    Free( &selected_roots );
-    Free( &p_articles );
-    Free( &strings );
+    safefree( &p_roots );
+    safefree( &root_subjects );
+    safefree( &author_cnts );
+    safefree( &subject_cnts );
+    safefree( &author_ptrs );
+    safefree( &subject_ptrs );
+    safefree( &root_article_cnts );
+    safefree( &selected_roots );
+    safefree( &p_articles );
+    safefree( &strings );
=
=    p_art = curr_p_art = Nullart;
Index: rthreads.h
@@ -1,5 +1,8 @@
-/* $Header: rthreads.h,v 4.3.3.1 90/06/20 22:56:01 davison Trn $
+/* $Header: rthreads.h,v 4.3.3.2 91/01/16 03:28:54 davison Trn $
=**
=** $Log:	rthreads.h,v $
+** Revision 4.3.3.2  91/01/16  03:28:54  davison
+** Added optional prototyping.
+** 
=** Revision 4.3.3.1  90/06/20  22:56:01  davison
=** Initial Trn Release
@@ -36,14 +39,23 @@
=EXT BMAP my_bmap, mt_bmap;
=
-void thread_init(), mybytemap();
-char *thread_name(), *safemalloc();
-int use_data();
-void unuse_data();
-void find_article(), init_tree(), entire_tree();
-int tree_puts(), finish_tree();
-void first_art(), follow_thread(), next_root(), prev_root();
-char select_thread();
-int count_roots(), count_one_root();
-PACKED_ARTICLE *upper_limit();
+void thread_init ANSI((void));
+void mybytemap ANSI((BMAP *));
+char *thread_name ANSI((char *));
+char *safemalloc ANSI((MEM_SIZE));
+int use_data ANSI((char *));
+void unuse_data ANSI((bool));
+void find_article ANSI((ART_NUM));
+void init_tree ANSI((void));
+void entire_tree ANSI((void));
+int tree_puts ANSI((char *,ART_LINE,int));
+int finish_tree ANSI((ART_LINE));
+void first_art ANSI((void));
+void follow_thread ANSI((char));
+void next_root ANSI((void));
+void prev_root ANSI((void));
+char select_thread ANSI((char));
+int count_roots ANSI((bool));
+int count_one_root ANSI((int));
+PACKED_ARTICLE *upper_limit ANSI((PACKED_ARTICLE *,bool));
=
=#define Nullart Null(PACKED_ARTICLE*)
Index: search.h
@@ -1,5 +1,8 @@
-/* $Header: search.h,v 4.3 85/05/01 11:50:46 lwall Exp $
+/* $Header: search.h,v 4.3.3.1 91/01/16 03:37:37 davison Trn $
= *
= * $Log:	search.h,v $
+ * Revision 4.3.3.1  91/01/16  03:37:37  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:50:46  lwall
= * Baseline for release with 4.3bsd.
@@ -24,14 +27,14 @@
=} COMPEX;
=
-void	search_init();
-void	init_compex();
-void	free_compex();
-char	*getbracket();
-void	case_fold();
-char	*compile(); 
-void	grow_eb();
-char	*execute(); 
-bool	advance();
-bool	backref(); 
-bool	cclass(); 
+void	search_init ANSI((void));
+void	init_compex ANSI((COMPEX *));
+void	free_compex ANSI((COMPEX *));
+char	*getbracket ANSI((COMPEX *,int));
+void	case_fold ANSI((int));
+char	*compile ANSI((COMPEX *,char *,int,int)); 
+void	grow_eb ANSI((COMPEX *));
+char	*execute ANSI((COMPEX *,char *)); 
+bool	advance ANSI((COMPEX *,char *,char *));
+bool	backref ANSI((COMPEX *,int,char *)); 
+bool	cclass ANSI((char *,int,int));
=#endif
Index: sw.c
@@ -1,7 +1,13 @@
-/* $Header: sw.c,v 4.3.3.1 90/06/20 22:40:11 davison Trn $
+/* $Header: sw.c,v 4.3.3.2 91/01/16 03:37:38 davison Trn $
= *
= * $Log:	sw.c,v $
+ * Revision 4.3.3.2  91/01/16  03:37:38  davison
+ * Integrated rn patches 48-54.
+ * 
= * Revision 4.3.3.1  90/06/20  22:40:11  davison
= * Initial Trn Release
+ * 
+ * Revision 4.3.2.4  90/11/22  16:09:19  sob
+ * Added changes to accomodate pickly C preprocessors
= * 
= * Revision 4.3.2.3  90/05/08  22:06:00  sob
Index: sw.h
@@ -1,5 +1,8 @@
-/* $Header: sw.h,v 4.3 85/05/01 11:51:07 lwall Exp $
+/* $Header: sw.h,v 4.3.3.1 91/01/16 03:37:39 davison Trn $
= *
= * $Log:	sw.h,v $
+ * Revision 4.3.3.1  91/01/16  03:37:39  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:51:07  lwall
= * Baseline for release with 4.3bsd.
@@ -11,8 +14,8 @@
=#endif
=
-void    sw_init();
-void    sw_file();
-void    sw_list();
-void	decode_switch();
-void	pr_switches();
-void	cwd_check();
+void    sw_init ANSI((int,char **,char **));
+void    sw_file ANSI((char **,bool));
+void    sw_list ANSI((char *));
+void	decode_switch ANSI((char *));
+void	pr_switches ANSI((void));
+void	cwd_check ANSI((void));
Index: term.c
@@ -1,8 +1,29 @@
-/* $Header: term.c,v 4.3.3.1 90/07/28 18:09:09 davison Trn $
+/* $Header: term.c,v 4.3.3.2 91/01/16 03:38:36 davison Trn $
= *
= * $Log:	term.c,v $
+ * Revision 4.3.3.2  91/01/16  03:38:36  davison
+ * Integrated rn patches 48-54.  Revised 8-bit character support.
+ * 
= * Revision 4.3.3.1  90/07/28  18:09:09  davison
= * Initial Trn Release
= * 
+ * Revision 4.3.2.13  90/12/12  03:03:28  sob
+ * Lost a closing paren in circfill()
+ * 
+ * Revision 4.3.2.12  90/12/10  01:33:54  sob
+ * First attempts to make rn "8 bit clean"
+ * 
+ * Revision 4.3.2.11  90/11/22  13:34:06  sob
+ * Added a change to circfill to make it work with POSIX-compliant OSes.
+ * 
+ * Revision 4.3.2.10  90/11/05  23:41:29  sob
+ * Now it's gone.
+ * 
+ * Revision 4.3.2.9  90/11/05  23:30:07  sob
+ * moved the winsize struct in anticipation of removing it.
+ * 
+ * Revision 4.3.2.8  90/10/01  01:43:59  sob
+ * Fixed syntax error pointed out by stealth at m-net.ann-arbor.mi.us.
+ * 
= * Revision 4.3.2.7  90/04/21  16:54:29  sob
= * Installed patches provided by SCO for SCO Xenix
@@ -52,9 +73,4 @@
=#include "term.h"
=
-#ifdef SYS_PTEM
-#include <sys/stream.h>
-#include <sys/ptem.h>
-#endif
-
=char ERASECH;		/* rubout character */
=char KILLCH;		/* line delete character */
@@ -159,12 +175,4 @@
=    int status;
=#ifdef TIOCGWINSZ
-#ifdef u3b2
-struct winsize {
-	unsigned short ws_row;       /* rows, in characters*/
-	unsigned short ws_col;       /* columns, in character */
-	unsigned short ws_xpixel;    /* horizontal size, pixels */
-	unsigned short ws_ypixel;    /* vertical size, pixels */
-};
-#endif
=    struct winsize winsize;
=#endif
@@ -222,4 +230,5 @@
=    if (!*CE || !*CD || !can_home)	/* can we CE, CD, and home? */
=	can_home_clear = FALSE;		/*  no, so disable use of clear eol */
+    if (!*CE) CE = CD;
=#endif /* CLEAREOL */
=#ifdef USETHREADS
@@ -463,5 +472,5 @@
=    do {
=      top:
-	if ((unsigned char)*s < ' ') {
+	if (*(unsigned char *)s < ' ') {
=	    putchar('^');
=	    putchar(*s | 64);
@@ -525,5 +534,5 @@
=	    rubout();
=	    s--;			/* discount the char rubbed out */
-	    if ((unsigned char)*s < ' ' || *s == '\177')
+	    if (*(unsigned char *)s < ' ' || *s == '\177')
=		rubout();
=	    if (s == buf) {		/* entire string gone? */
@@ -537,5 +546,5 @@
=	    while (s-- != buf) {	/* emulate that many ERASEs */
=		rubout();
-		if ((unsigned char)*s < ' ' || *s == '\177')
+		if (*(unsigned char *)s < ' ' || *s == '\177')
=		    rubout();
=	    }
@@ -552,5 +561,5 @@
=		    return FALSE;	/* return to single char mode */
=		}
-		if ((unsigned char)*s < ' ' || *s == '\177')
+		if (*(unsigned char *)s < ' ' || *s == '\177')
=		    rubout();
=	    }
@@ -640,6 +649,11 @@
=circfill()
={
-    register int Howmany = read(devtty,circlebuf+nextin,1);
+    register int Howmany;
=
+    errno = 0;
+    Howmany = read(devtty,circlebuf+nextin,1);
+
+    if (Howmany < 0 && (errno == EAGAIN || errno == EINTR))
+	Howmany = 0;
=    if (Howmany) {
=	nextin += Howmany;
@@ -699,5 +713,5 @@
=    if (*UC) {		/* char by char underline? */
=	while (*s) {
-	    if ((unsigned char)*s < ' ') {
+	    if (*(unsigned char *)s < ' ') {
=		putchar('^');
=		backspace();/* back up over it */
@@ -718,5 +732,5 @@
=	underline();	/* start underlining */
=	while (*s) {
-	    if ((unsigned char)*s < ' ') {
+	    if (*(unsigned char *)s < ' ') {
=		putchar('^');
=		putchar(*s+64);
@@ -776,8 +790,9 @@
=	int_count = 0;
=	errno = 0;
-	if (read_tty(whatbuf,1) < 0)
+	if (read_tty(whatbuf,1) < 0){
=	    if (!errno)
=	        errno = EINTR;
-	    else {
+	    if (errno == EINTR)
+		return;
=	    perror(readerr);
=	    sig_catcher(0);
@@ -1002,5 +1017,5 @@
=	    if (!*s)
=		break;
-	    if ((unsigned char)*s >= ' ')
+	    if (*(unsigned char *)s >= ' ')
=		putchar(*s);
=	    else if (*s == '\t') {
@@ -1060,5 +1075,5 @@
={
=    if (verify && buf[1] == FINISHCMD) {
-	if ((unsigned char)*buf < ' ') {
+	if (*(unsigned char *)buf < ' ') {
=	    putchar('^');
=	    putchar(*buf | 64);
@@ -1090,5 +1105,5 @@
=    fputs("^R\n",stdout) FLUSH;
=    for (s = buf; *s; s++) {
-	if ((unsigned char)*s < ' ') {
+	if (*(unsigned char *)s < ' ') {
=	    putchar('^');
=	    putchar(*s | 64);
Index: term.h
@@ -1,8 +1,23 @@
-/* $Header: term.h,v 4.3.3.1 90/06/20 22:40:34 davison Trn $
+/* $Header: term.h,v 4.3.3.2 91/01/16 03:38:39 davison Trn $
= *
= * $Log:	term.h,v $
+ * Revision 4.3.3.2  91/01/16  03:38:39  davison
+ * Integrated rn patches 48-54.  Added optional prototyping.
+ * 
= * Revision 4.3.3.1  90/06/20  22:40:34  davison
= * Initial Trn Release
= * 
+ * Revision 4.3.2.6  90/12/10  01:32:08  sob
+ * Hopefully, the rn -e -L problem is now fixed.
+ * 
+ * Revision 4.3.2.5  90/11/22  13:48:09  sob
+ * Backed out change in Patch 48.
+ * 
+ * Revision 4.3.2.4  90/11/05  23:54:49  sob
+ * changed maybe_eol to test when erase_screen is FALSE intstead of TRUE.
+ * 
+ * Revision 4.3.2.3  90/10/01  01:49:39  sob
+ * Changed ospeed from short to long.
+ * 
= * Revision 4.3.2.2  90/04/06  20:35:34  sob
= * Added fixes for SCO Xenix sent by ronald at robobar.co.uk.
@@ -161,8 +176,10 @@
=EXT char *CL INIT(Nullch);		/* home and clear screen */
=EXT char *CE INIT(Nullch);		/* clear to end of line */
+#if defined(CLEAREOL) || defined(USETHREADS)
+EXT char *CM INIT(Nullch);		/* cursor motion */
+EXT char *HO INIT(Nullch);		/* home cursor */
+#endif
=#ifdef CLEAREOL
-EXT char *CM INIT(Nullch);		/* cursor motion -- PWP */
-EXT char *HO INIT(Nullch);		/* home cursor -- PWP */
-EXT char *CD INIT(Nullch);		/* clear to end of display -- PWP */
+EXT char *CD INIT(Nullch);		/* clear to end of display */
=#endif /* CLEAREOL */
=EXT char *SO INIT(Nullch);		/* begin standout mode */
@@ -176,5 +193,5 @@
=EXT bool XN INIT(FALSE);		/* does it eat 1st newline after automatic wrap? */
=EXT char PC INIT(0);		/* pad character for use by tputs() */
-EXT short ospeed INIT(0);	/* terminal output speed, for use by tputs() */
+EXT long ospeed INIT(0);	/* terminal output speed, for use by tputs() */
=EXT int LINES INIT(0), COLS INIT(0);	/* size of screen */
=EXT int just_a_sec INIT(960);			/* 1 sec at current baud rate */
@@ -187,5 +204,5 @@
=#define erase_eol() tputs(CE,1,putchr) FLUSH
=#ifdef CLEAREOL
-#define clear_rest() tputs(CD,LINES,putchr) FLUSH	/* PWP */
+#define clear_rest() tputs(CD,LINES,putchr) FLUSH
=#define maybe_eol() if(erase_screen&&can_home_clear)tputs(CE,1,putchr) FLUSH
=#endif /* CLEAREOL */
@@ -204,40 +221,40 @@
=EXT int page_line INIT(1);	/* line number for paging in print_line (origin 1) */
=
-void	term_init();
-void	term_set();
+void	term_init ANSI((void));
+void	term_set ANSI((char *));
=#ifdef PUSHBACK
-void	pushchar();
-void	mac_init();
-void	mac_line();
-void	show_macros();
+void	pushchar ANSI((char));
+void	mac_init ANSI((char *));
+void	mac_line ANSI((char *,char *,int));
+void	show_macros ANSI((void));
=#endif
-char	putchr();	/* routine for tputs to call */
-bool	finish_command();
-void	eat_typeahead();
-void	settle_down();
+char	putchr ANSI((char));	/* routine for tputs to call */
+bool	finish_command ANSI((int));
+void	eat_typeahead ANSI((void));
+void	settle_down ANSI((void));
=#ifndef read_tty
-    int		read_tty();
+    int		read_tty ANSI((char *,int));
=#endif
-void	underprint();
+void	underprint ANSI((char *));
=#ifdef NOFIREWORKS
-    void	no_sofire();
-    void	no_ulfire();
+    void	no_sofire ANSI((void));
+    void	no_ulfire ANSI((void));
=#endif
-void	getcmd();
-int	get_anything();
-void	in_char();
-int	print_lines();
-void	page_init();
-void	pad();
-void	printcmd();
-void	rubout();
-void	reprint();
+void	getcmd ANSI((char *));
+int	get_anything ANSI((void));
+void	in_char ANSI((char *,char));
+int	print_lines ANSI((char *,int));
+void	page_init ANSI((void));
+void	pad ANSI((int));
+void	printcmd ANSI((void));
+void	rubout ANSI((void));
+void	reprint ANSI((void));
=#if defined(CLEAREOL) || defined(USETHREADS)
-void	home_cursor();
+void	home_cursor ANSI((void));
=#endif
=#ifdef USETHREADS
-void	goto_line();
+void	goto_line ANSI((int,int));
=#endif
=#ifdef SIGWINCH
-int	winch_catcher();
+int	winch_catcher ANSI((void));
=#endif /* SIGWINCH */
Index: trn.1
@@ -1,5 +1,8 @@
-''' $Header: trn.1,v 4.3.3.2 90/08/20 16:50:51 davison Trn $
+''' $Header: trn.1,v 4.3.3.3 91/01/16 03:38:44 davison Trn $
=''' 
=''' $Log:	trn.1,v $
+''' Revision 4.3.3.3  91/01/16  03:38:44  davison
+''' Integrated rn patches 48-54.
+''' 
=''' Revision 4.3.3.2  90/08/20  16:50:51  davison
=''' Changed email address.
@@ -8,4 +11,14 @@
=''' Initial Trn Release
=''' 
+''' Revision 4.3.2.2  90/12/12  03:48:54  sob
+''' Added documentation for the new "N" command at startup newsgroup
+''' selection.
+''' 
+''' Revision 4.3.2.1  90/11/26  02:12:34  sob
+''' Added information about environmental variables NEWSRC and NNTPSERVER.
+''' 
+''' Revision 4.3.1.10  90/11/06  01:17:29  sob
+''' Added text about new Y response when adding newsgroups.
+''' 
=''' Revision 4.3.1.9  90/05/08  22:05:11  sob
=''' Added documentation for new -q flag
@@ -348,5 +361,9 @@
=not, will not be listed.
=If any new newsgroups are found, you will be asked for each one whether
-you would like to add it.
+you would like to add it. If you want to add all new newsgroups, you can
+type \*(L'Y\*(R' and they will be added the the end of the
+.I .newsrc
+file and as groups you want to read. If you don't want to subscribe, all
+the new groups can be added by typing  \*(L'N\*(R'.
=After any new newsgroups have been added, the \*(L'a\*(R' command also
=restricts the current set of newsgroups just like the \*(L'o\*(R' command
@@ -1895,4 +1912,14 @@
=.Sp
=Default: Pnews \-h %h
+.Ip NEWSRC 8
+Your newsgroup subscription list.
+.Sp
+Default: $HOME/.newsrc
+.Ip NNTPSERVER 8
+The hostname of your NNTPSERVER. [This does not apply unless you are running
+the NNTP version of rn.]
+.Sp
+Default: the hostname listed in the server file, usually
+/usr/local/lib/rn/server.
=.Ip NOPOSTRING 8
=The string to insert in the group summary line, which heads each article,
Index: util.c
@@ -1,5 +1,8 @@
-/* $Header: util.c,v 4.3.3.2 90/08/20 16:51:44 davison Trn $
+/* $Header: util.c,v 4.3.3.3 91/01/16 03:41:50 davison Trn $
= *
= * $Log:	util.c,v $
+ * Revision 4.3.3.3  91/01/16  03:41:50  davison
+ * Integrated rn patches 48-54.
+ * 
= * Revision 4.3.3.2  90/08/20  16:51:44  davison
= * Fixed getcwd call to not overflow any buffers.
@@ -8,4 +11,11 @@
= * Initial Trn Release
= * 
+ * Revision 4.3.2.8  90/11/22  13:54:06  sob
+ * Made changes to keep more preprocessors happy.
+ * 
+ * Revision 4.3.2.7  90/10/01  01:52:18  sob
+ * Altered the preprocessor defines on GETWD/GETCWD per suggestion by
+ * rsm at math.arizona.edu.
+ * 
= * Revision 4.3.2.6  90/04/23  00:24:42  sob
= * A bit of clean up.
@@ -57,5 +67,4 @@
={
=    int status, pid, w;
-    SIGRET (*signal())();
=    char *shell;
=
@@ -86,5 +95,7 @@
=    }
=    signal(SIGINT, SIG_IGN);
+#ifdef SIGQUIT
=    signal(SIGQUIT, SIG_IGN);
+#endif
=    waiting = TRUE;
=    while ((w = wait(&status)) != pid && w != -1)
@@ -94,5 +105,7 @@
=    waiting = FALSE;
=    sigset(SIGINT, int_catcher);	/* always catch interrupts */
+#ifdef SIGQUIT
=    signal(SIGQUIT, SIG_DFL);
+#endif
=#ifdef SIGTSTP
=    sigset(SIGTSTP,stop_catcher);
@@ -258,4 +271,5 @@
= * Get working directory
= */
+#ifndef GETWD
=#ifdef GETCWD
=char *
@@ -269,5 +283,4 @@
=}
=#else
-#ifndef GETWD
=char *
=getwd(np)			/* shorter but slower */
Index: util.h
@@ -1,5 +1,8 @@
-/* $Header: util.h,v 4.3 85/05/01 11:51:58 lwall Exp $
+/* $Header: util.h,v 4.3.3.1 91/01/16 03:41:51 davison Trn $
= *
= * $Log:	util.h,v $
+ * Revision 4.3.3.1  91/01/16  03:41:51  davison
+ * Added optional prototyping.
+ * 
= * Revision 4.3  85/05/01  11:51:58  lwall
= * Baseline for release with 4.3bsd.
@@ -17,25 +20,23 @@
=#define MD_FILE 1
=
-void	util_init();
-int	doshell();
-char	*safemalloc();
-char	*saferealloc();
-char	*safecpy();
-char	*safecat();
-char	*cpytill();
-char	*instr();
+void	util_init ANSI((void));
+int	doshell ANSI((char *,char *));
+char	*safemalloc ANSI((MEM_SIZE));
+char	*saferealloc ANSI((char *,MEM_SIZE));
+char	*safecpy ANSI((char *,char *,int));
+char	*safecat ANSI((char *,char *,int));
+char	*cpytill ANSI((char *,char *,int));
+char	*instr ANSI((char *,char *));
=#ifdef SETUIDGID
-    int		eaccess();
+    int		eaccess ANSI((char *,int));
=#endif
-char	*getwd();
-void	cat();
-void	prexit();
-char	*get_a_line();
-char	*savestr();
-int	makedir();
-void	setenv();
-int	envix();
-void	notincl();
-char	*getval();
-void	growstr();
-void	setdef();
+char	*getwd ANSI((char *));
+char	*get_a_line ANSI((char *,int,FILE *));
+char	*savestr ANSI((char *));
+int	makedir ANSI((char *,int));
+void	setenv ANSI((char *,char *));
+int	envix ANSI((char *));
+void	notincl ANSI((char *));
+char	*getval ANSI((char *,char *));
+void	growstr ANSI((char **,int *,int));
+void	setdef ANSI((char *,char *));
Index: uudecode.c
@@ -1,5 +1,8 @@
-/* $Header: uudecode.c,v 4.3.3.1 90/06/20 22:48:21 davison Trn $
+/* $Header: uudecode.c,v 4.3.3.2 91/01/16 03:41:52 davison Trn $
=**
=** $Log:	uudecode.c,v $
+** Revision 4.3.3.2  91/01/16  03:41:52  davison
+** Tweaked fopen for possible binary open mode.
+** 
=** Revision 4.3.3.1  90/06/20  22:48:21  davison
=** Initial Trn Release
@@ -126,5 +129,5 @@
=		    strcpy(dest, uu_fname);
=
-		if ((uu_out = fopen(dest, "w")) == Nullfp) {
+		if ((uu_out = fopen(dest, FOPEN_WB)) == Nullfp) {
=		    printf("Cannot create file: %s\n", dest);
=		    goto err;
Index: uudecode.h
@@ -1,5 +1,8 @@
-/* $Header: uudecode.h,v 4.3.3.1 90/06/20 22:49:08 davison Trn $
+/* $Header: uudecode.h,v 4.3.3.2 91/01/16 03:41:53 davison Trn $
=**
=** $Log:	uudecode.h,v $
+** Revision 4.3.3.2  91/01/16  03:41:53  davison
+** Added optional prototyping.
+** 
=** Revision 4.3.3.1  90/06/20  22:49:08  davison
=** Initial Trn Release
@@ -9,2 +12,6 @@
=EXT FILE *uu_out INIT(NULL);
=EXT char uu_fname[MAXFILENAME];
+
+int uud_start ANSI((char *));
+int uud_send ANSI((void));
+int uudecode ANSI((FILE *));
SHAR_EOF
fi
exit 0
#	End of shell archive
----8<------8<------8<------8<-----the end------>8------>8------>8------>8----



More information about the Comp.sources.bugs mailing list