[news.software.b] news 2.11 src patch #10

rick@seismo.CSS.GOV (Rick Adams) (10/08/87)

Description:
	This is patch #10 for news 2.11 src.

	Remove 4.1C BSD conditionals.
	Lint and minor speedups.
	Batch accepts blanks lines in files.
	The IHCC define was replaced by several defines
	allowing you to select part of the IHCC functionality.
	Fix newgroup messages for moderated groups.
	Minor date conversion fix to expire.
	Lots of changes to run under Xenix (including locking I think).
	strcasecmp() routein used for case independant comparisons.
	strcmp,strncmp, prefix replaced with macros in an attempt
		to squeeze more speed out.
	Support for the "Supersedes:" header line added.
	Sendbatch fixed to work when 'test' is a builtin.
	New defines added to defs.dist:
		READDIR		(has opendir(), etc in libc)
		MKDIR_SUB	(mkdir() is in libc)
		DOGETUSER	(always do a getuser() - was part of IHCC)
		LOGDIR		(read pathnames from file - was part of IHCC)

Fix:
	cd to the src directory and apply the following patch.

Index: batch.c
Prereq: 1.18
*** .d/batch.c	Wed Oct  7 16:48:13 1987
--- batch.c	Wed Oct  7 18:48:54 1987
***************
*** 34,36 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)batch.c	1.18	12/16/86";
  #endif /* SCCSID */
--- 34,36 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)batch.c	1.19	10/7/87";
  #endif /* SCCSID */
***************
*** 43,45 ****
  
! #if defined(USG) || defined(BSD4_2) || defined(BSD4_1C)
  #include <fcntl.h>
--- 43,45 ----
  
! #if defined(USG) || defined(BSD4_2)
  #include <fcntl.h>
***************
*** 64,65 ****
--- 64,66 ----
  	char workfile[512];
+ 	char cbuf[BUFSIZ];
  	char *index(), *fgets();
***************
*** 102,103 ****
--- 103,106 ----
  			*cp = '\0';
+ 		if (fname[0] == '\0')
+ 			continue;
  		nfd = fopen(fname, "r");
***************
*** 110,111 ****
--- 113,116 ----
  			*cp = '\n';
+ 		if (sbuf.st_size == 0)
+ 			continue;
  		nbytes += sbuf.st_size;
***************
*** 117,121 ****
  		n = 0;
! 		while ((c = getc(nfd)) != EOF) {
! 			putchar(c);
! 			n++;
  		}
--- 122,126 ----
  		n = 0;
! 		while (c = fread(cbuf, 1, sizeof cbuf, nfd)) {
! 			fwrite(cbuf, 1, c, stdout);
! 			n += c;
  		}
***************
*** 126,127 ****
--- 131,133 ----
  		}
+ 		(void) fflush(stdout);
  		if (n != sbuf.st_size) { /* paranoia */
***************
*** 186,188 ****
  
! #if defined(IHCC) || defined(HOME)
  	(void) sprintf(lfname, "%s/%s/errlog", logdir(HOME), LIBDIR);
--- 192,194 ----
  
! #if defined(LOGDIR) || defined(HOME)
  	(void) sprintf(lfname, "%s/%s/errlog", logdir(HOME), LIBDIR);
***************
*** 195,197 ****
  	if (access(lfname, 0) == 0 && (logfile = fopen(lfname, "a")) != NULL) {
! #if defined(USG) || defined(BSD4_2) || defined(BSD4_1C)
  		int flags;
--- 201,203 ----
  	if (access(lfname, 0) == 0 && (logfile = fopen(lfname, "a")) != NULL) {
! #if defined(USG) || defined(BSD4_2)
  		int flags;
***************
*** 207,209 ****
  
! #if !defined(BSD4_2) && !defined(BSD4_1C)
  rename(from, to)
--- 213,215 ----
  
! #if !defined(BSD4_2)
  rename(from, to)
***************
*** 218,219 ****
  }
! #endif /* !BSD4_2 && !BSD4_1C */
--- 224,225 ----
  }
! #endif /* !BSD4_2 */

Index: control.c
Prereq: 2.54
*** .d/control.c	Wed Oct  7 16:49:54 1987
--- control.c	Wed Oct  7 18:48:56 1987
***************
*** 21,23 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)control.c	2.54	4/10/87";
  #endif /* SCCSID */
--- 21,23 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)control.c	2.55	10/7/87";
  #endif /* SCCSID */
***************
*** 306,308 ****
  	if (cp == NULL) {
! 		logerr("System %s wants unavailable article %s.",
  #ifdef MULTICAST
--- 306,308 ----
  	if (cp == NULL) {
! 		log("System %s wants unavailable article %s.",
  #ifdef MULTICAST
***************
*** 375,377 ****
  		if (*--q == '\0' && *--p == ' ') {
- 			int modified = 0;
  			/* Now check if it's correctly moderated/unmoderated */
--- 375,376 ----
***************
*** 385,395 ****
  				}
- # ifdef NONEWGROUPS
- 				if(can_change) {
- 					*p = 'm';
- 					modified = 1;
- 				}
- # else /* ! NONEWGROUPS */
  				*p = 'm';
- 				modified = 1;
- #endif /* NONEWGROUPS */
  			} else {
--- 384,386 ----
***************
*** 399,409 ****
  				}
- # ifdef NONEWGROUPS
- 				if(can_change)  {
- 					*p = 'y';
- 					modified = 1;
- 				}
- # else /* ! NONEWGROUPS */
  				*p = 'y';
- 				modified = 1;
- # endif /* NONEWGROUPS */
  			}
--- 390,392 ----
***************
*** 411,413 ****
  			(void) sprintf(subjline,
! 			"Newsgroup %s change from %smoderated to %smoderated",
  				argv[1], *p=='y' ? "" : "un",
--- 394,396 ----
  			(void) sprintf(subjline,
! 			"Newsgroup %s changed from %smoderated to %smoderated",
  				argv[1], *p=='y' ? "" : "un",
***************
*** 416,418 ****
  			if (fd != NULL) {
! 				if(modified)
  					fprintf(fd,
--- 399,401 ----
  			if (fd != NULL) {
! 				if(can_change)
  					fprintf(fd,
***************
*** 433,436 ****
  					fprintf(fd,
! 				"%s/inews -d %s -C %s moderated\n",
! 						LIB, ORGDISTRIB, argv[1]);
  #else /* !ORGDISTRIB */
--- 416,420 ----
  					fprintf(fd,
! 				"%s/inews -d %s -C %s%s\n",
! 						LIB, ORGDISTRIB, argv[1],
! 						*p=='y' ? "" : " moderated");
  #else /* !ORGDISTRIB */
***************
*** 438,441 ****
  "You can accomplish this by re-creating the newsgroup by executing the command:\n");
! 					fprintf(fd, "%s/inews -C %s moderated\n",
! 						LIB, argv[1]);
  #endif /* !ORGDISTRIB */
--- 422,426 ----
  "You can accomplish this by re-creating the newsgroup by executing the command:\n");
! 					fprintf(fd, "%s/inews -C %s%s\n",
! 						LIB, argv[1],
! 						*p=='y' ? "" : " moderated");
  #endif /* !ORGDISTRIB */
***************
*** 504,507 ****
  			fprintf(fd, 
! 		"A new newsgroup called '%s' has been created by %s.\n",
! 							argv[1], header.path);
  		else {
--- 489,493 ----
  			fprintf(fd, 
! 		"A new %snewsgroup called '%s' has been created by %s.\n",
! 				argc > 2 ? "moderated " : "", argv[1],
! 				header.path);
  		else {
***************
*** 508,511 ****
  			fprintf(fd, 
! 		"%s requested that a new newsgroup called '%s' be created.\n",
! 			header.path, argv[1]);
  			fprintf(fd,"It was approved by %s\n\n",header.approved);
--- 494,497 ----
  			fprintf(fd, 
! 		"%s requested that a new %snewsgroup called '%s' be created.\n",
! 			header.path, argc > 2 ? "moderated " : "", argv[1]);
  			fprintf(fd,"It was approved by %s\n\n",header.approved);
***************
*** 597,599 ****
  
! 		if (pid = vfork()) {
  			status = fwait(pid);
--- 583,585 ----
  
! 		if (pid = fork()) {
  			status = fwait(pid);
***************
*** 600,601 ****
--- 586,591 ----
  		} else {
+ 			register int i;
+ 			for (i =3; i<20; i++)
+ 				if (close(i) < 0)
+ 					break;
  			(void) setuid(duid);
***************
*** 674,676 ****
  			log("Can't cancel %s: %s", line, errmsg(errno));
! 			return 1;
  		}
--- 664,666 ----
  			log("Can't cancel %s: %s", line, errmsg(errno));
! 			return -1;
  		}
***************
*** 855,857 ****
  #endif /* NOTIFY */
! 		if (sendto == NULL || *sendto == NULL)
  			return NULL;
--- 845,847 ----
  #endif /* NOTIFY */
! 		if (sendto == NULL || *sendto == '\0')
  			return NULL;
***************
*** 877,879 ****
  #endif /* MMDF */
! 		execl("/bin/mail", "mail", sendto, (char *)NULL);
  		execl("/usr/bin/mail", "mail", sendto, (char *)NULL);
--- 867,869 ----
  #endif /* MMDF */
! 		execl("/usr/bin/mailx", "mail", sendto, (char *)NULL);
  		execl("/usr/bin/mail", "mail", sendto, (char *)NULL);
***************
*** 880,881 ****
--- 870,872 ----
  		execl("/usr/ucb/mail", "mail", sendto, (char *)NULL);
+ 		execl("/bin/mail", "mail", sendto, (char *)NULL);
  		_exit(1);
***************
*** 1015,1017 ****
  	} else if (strcmp(msg, "delsub") == 0) {
! 		if (!prefix(header.nbuf, "to.")) {
  			log("Must be in a 'to.system' newsgroup.");
--- 1006,1008 ----
  	} else if (strcmp(msg, "delsub") == 0) {
! 		if (!PREFIX(header.nbuf, "to.")) {
  			log("Must be in a 'to.system' newsgroup.");

Index: expire.c
Prereq: 2.53
*** .d/expire.c	Wed Oct  7 16:50:41 1987
--- expire.c	Wed Oct  7 18:48:58 1987
***************
*** 19,21 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)expire.c	2.53	4/6/87";
  #endif /* SCCSID */
--- 19,21 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)expire.c	2.54	10/7/87";
  #endif /* SCCSID */
***************
*** 24,31 ****
  #include <errno.h>
! #if defined(BSD4_2) || defined(BSD4_1C)
! # include <sys/dir.h>
  # include <sys/file.h>
! #else
! # include "ndir.h"
! #endif
  
--- 24,29 ----
  #include <errno.h>
! 
! #ifdef BSD4_2
  # include <sys/file.h>
! #endif /* BSD4_2 */
  
***************
*** 78,81 ****
  unsigned int mh_size;
! char *calloc();
! char *realloc();
  struct tm *gmtime();
--- 76,78 ----
  unsigned int mh_size;
! extern char *calloc(), *realloc();
  struct tm *gmtime();
***************
*** 82,89 ****
  
! #ifdef DBM
! typedef struct {
! 	char *dptr;
! 	int dsize;
! } datum;
! #else
  FILE *nexthistfile();
--- 79,81 ----
  
! #ifndef DBM
  FILE *nexthistfile();
***************
*** 105,107 ****
  struct hbuf h;
- int	ExpireLock;
  int	rmlock();
--- 97,98 ----
***************
*** 317,319 ****
  #endif /* PROFILING */
! #ifdef IHCC
  	/*afline happens to be available - (we're getting out anyway)*/
--- 308,310 ----
  #endif /* PROFILING */
! #ifdef LOGDIR
  	/*afline happens to be available - (we're getting out anyway)*/
***************
*** 321,325 ****
  	execl(afline, "rnews", "-U", (char *)NULL);
! #else /* ! IHCC */
  	execl(RNEWS, "rnews", "-U", (char *)NULL);
! #endif /* ! IHCC */
  	perror(RNEWS);
--- 312,316 ----
  	execl(afline, "rnews", "-U", (char *)NULL);
! #else /* ! LOGDIR */
  	execl(RNEWS, "rnews", "-U", (char *)NULL);
! #endif /* ! LOGDIR */
  	perror(RNEWS);
***************
*** 359,361 ****
  
! 			(void) sprintf(afline, "exec sort -t\t +1.6 -2 +1 >%s", NARTFILE);
  			if ((nhfd = popen(afline, "w")) == NULL)
--- 350,357 ----
  
! 			(void) sprintf(afline, "exec sort -t\t +1.6 -2 +1 >%s",
! #ifdef DBM
! 			NARTFILE);
! #else /* !DBM */
! 			ARTFILE);
! #endif /* !DBM */
  			if ((nhfd = popen(afline, "w")) == NULL)
***************
*** 393,395 ****
  					if (p1 != NULL)
! 						*p1 = NULL;
  					if (!ngmatch(nbuf, ngpat))
--- 389,391 ----
  					if (p1 != NULL)
! 						*p1 = '\0';
  					if (!ngmatch(nbuf, ngpat))
***************
*** 441,442 ****
--- 437,439 ----
  			(void) strcpy(recdate, p1+1);
+ 			(void) strcat(recdate, " GMT");
  			rectime = cgtdate(recdate);
***************
*** 770,772 ****
  	if (dorebuild || !nohistory) {
! #ifndef DBM
  		(void) rename(ARTFILE, OARTFILE);
--- 767,769 ----
  	if (dorebuild || !nohistory) {
! #ifdef DBM
  		(void) rename(ARTFILE, OARTFILE);
***************
*** 800,802 ****
  # ifdef	LOCKF
! 	if (lockf(LockFd, F_LOCK, 0) < 0)
  # else	/* BSD4_2 */
--- 797,799 ----
  # ifdef	LOCKF
! 	if (lockf(LockFd, F_LOCK, 0L) < 0)
  # else	/* BSD4_2 */
***************
*** 809,812 ****
  	while (LINK(ACTIVE, afline) < 0 && errno == EEXIST) {
! 		if (i++ > 5)
! 			xerror("Can't get lock for expire");
  		sleep(i*2);
--- 806,811 ----
  	while (LINK(ACTIVE, afline) < 0 && errno == EEXIST) {
! 		if (i++ > 5) {
! 			error("Can't get lock for expire");
! 			exit(1);
! 		}
  		sleep(i*2);
***************
*** 934,942 ****
  			}
- 			if (p == NULL) {
- 				last = 1;
- 				fn = dirname(artlist);
- 				if (UNLINK(fn) < 0 && errno != ENOENT)
- 					perror(fn);
- 				return;
- 			}
  			if (p)
--- 933,934 ----
***************
*** 1156,1158 ****
  
! FILE *nexthistfile(ofp)
  FILE *ofp;
--- 1148,1151 ----
  
! FILE *
! nexthistfile(ofp)
  FILE *ofp;

Index: funcs.c
Prereq: 2.35
*** .d/funcs.c	Wed Oct  7 16:50:58 1987
--- funcs.c	Wed Oct  7 18:49:00 1987
***************
*** 18,20 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)funcs.c	2.35	12/16/86";
  #endif /* SCCSID */
--- 18,20 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)funcs.c	2.36	10/7/87";
  #endif /* SCCSID */
***************
*** 233,235 ****
--- 233,299 ----
  }
+ /* From UC Berkeley @(#)strcasecmp.c	1.3 (Berkeley) 8/3/87 */
  
+ /*
+  * This array is designed for mapping upper and lower case letter
+  * together for a case independent comparison.  The mappings are
+  * based upon ascii character sequences.
+  */
+ char charmap[] = {
+ 	'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
+ 	'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
+ 	'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
+ 	'\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
+ 	'\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
+ 	'\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
+ 	'\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
+ 	'\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
+ 	'\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ 	'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ 	'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ 	'\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
+ 	'\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+ 	'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+ 	'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+ 	'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
+ 	'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
+ 	'\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
+ 	'\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
+ 	'\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
+ 	'\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
+ 	'\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
+ 	'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
+ 	'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
+ 	'\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ 	'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ 	'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ 	'\370', '\371', '\372', '\333', '\334', '\335', '\336', '\337',
+ 	'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+ 	'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+ 	'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+ 	'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+ };
+ 
+ strcasecmp(s1, s2)
+ register char *s1, *s2;
+ {
+ 	register char *cm = charmap;
+ 
+ 	while (cm[*s1] == cm[*s2++])
+ 		if (*s1++ == '\0')
+ 			return 0;
+ 	return cm[*s1] - cm[*--s2];
+ }
+ 
+ strncasecmp(s1, s2, n)
+ register char *s1, *s2;
+ register int n;
+ {
+ 	register char *cm = charmap;
+ 
+ 	while (--n >= 0 && cm[*s1] == cm[*s2++])
+ 		if (*s1++ == '\0')
+ 			return 0;
+ 	return n < 0 ? 0 : cm[*s1] - cm[*--s2];
+ }
+ 
  prefix(full, pref)
***************
*** 237,247 ****
  {
! 	register char fc, pc;
  
! 	while ((pc = *pref++) != '\0') {
! 		fc = *full++;
! 		if (isupper(fc))
! 			fc = tolower(fc);
! 		if (isupper(pc))
! 			pc = tolower(pc);
! 		if (fc != pc)
  			return FALSE;
--- 301,306 ----
  {
! 	register char *cm = charmap;
  
! 	while (*pref != '\0') {
! 		if (cm[*full++] != cm[*pref++])
  			return FALSE;
***************
*** 591,592 ****
--- 650,654 ----
  		while (fscanf(facfd, "%[^:]:%s\n", facuser, factemp) != EOF)
+ 		{
+ 			if (feof(facfd))
+ 				break;
  			if (strncmp(facuser, user, BUFLEN) == 0) {
***************
*** 596,597 ****
--- 658,660 ----
  			}
+ 		}
  		fclose (facfd);
Index: funcs2.c
Prereq: 1.20
*** .d/funcs2.c	Wed Oct  7 16:51:19 1987
--- funcs2.c	Wed Oct  7 18:49:01 1987
***************
*** 19,21 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)funcs2.c	1.20	3/20/87";
  #endif /* SCCSID */
--- 19,21 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)funcs2.c	1.21	10/7/87";
  #endif /* SCCSID */
***************
*** 128,130 ****
  	 */
! 	if (strcmp(sp->s_name, "ME") == 0)
  		(void) strcpy(sp->s_name, LOCALPATHSYSNAME);
--- 128,130 ----
  	 */
! 	if (STRCMP(sp->s_name, "ME") == 0)
  		(void) strcpy(sp->s_name, LOCALPATHSYSNAME);
***************
*** 170,172 ****
  	while (s_read(sp))
! 		if (strncmp(system, sp->s_name, SNLN) == 0) {
  			s_close();
--- 170,172 ----
  	while (s_read(sp))
! 		if (STRNCMP(system, sp->s_name, SNLN) == 0) {
  			s_close();
***************
*** 196,198 ****
  
! 	if ( lastdatestr[0] && strcmp(datestr, lastdatestr) == 0)
  		return lasttime;
--- 196,198 ----
  
! 	if ( lastdatestr[0] && STRCMP(datestr, lastdatestr) == 0)
  		return lasttime;
***************
*** 203,204 ****
--- 203,209 ----
  		lasttime = getdate(bfr, &Now);
+ 		if (lasttime < 0) {
+ 			logerr("Unparsable date \"%s\"", datestr);
+ 			datestr = "now";	/* better than nothing */
+ 			lasttime = Now.time;
+ 		}
  	}
***************
*** 320,322 ****
  	ptr = hptr->path;
! 	if (prefix(ptr, PATHSYSNAME) &&
  		index(NETCHRS, ptr[strlen(PATHSYSNAME)]))
--- 325,327 ----
  	ptr = hptr->path;
! 	if (PREFIX(ptr, PATHSYSNAME) &&
  		index(NETCHRS, ptr[strlen(PATHSYSNAME)]))
***************
*** 328,329 ****
--- 333,337 ----
  		ptr = hptr->replyto;
+ #else /* !INTERNET */
+ 	if (hptr->replyto[0] && !index(hptr->replyto, '@'))
+ 		ptr = hptr->replyto;
  #endif
***************
*** 338,340 ****
  	if (ptr = rindex(tbuf, '.')) {
! 		if (prefix(++ptr, "OZ")) {
  			/* some people only allow it in lower case ... */
--- 346,348 ----
  	if (ptr = rindex(tbuf, '.')) {
! 		if (PREFIX(++ptr, "OZ")) {
  			/* some people only allow it in lower case ... */
***************
*** 343,346 ****
  		}
! 		if (prefix(ptr, "UUCP") || prefix(ptr, "ARPA") ||
! 		    prefix(ptr, "DEC") || prefix(ptr, "CSNET")) {
  			strcat(tbuf, "@munnari.oz");	/* via sun to munnari */
--- 351,354 ----
  		}
! 		if (PREFIX(ptr, "UUCP") || PREFIX(ptr, "ARPA") ||
! 		    PREFIX(ptr, "DEC") || PREFIX(ptr, "CSNET")) {
  			strcat(tbuf, "@munnari.oz");	/* via sun to munnari */
***************
*** 354,356 ****
  	for (ptr = tbuf ;; ptr++) {
! 		if (prefix(ptr, "munnari!")) {
  			strcpy(tbuf, ptr+8);
--- 362,364 ----
  	for (ptr = tbuf ;; ptr++) {
! 		if (PREFIX(ptr, "munnari!")) {
  			strcpy(tbuf, ptr+8);
***************
*** 392,394 ****
  				LIB);
! 	} while (!prefix(mbuf, "internet"));
  	if (sscanf(mbuf, "%*s %s", modadd) != 1)
--- 400,402 ----
  				LIB);
! 	} while (!PREFIX(mbuf, "internet"));
  	if (sscanf(mbuf, "%*s %s", modadd) != 1)
***************
*** 420,428 ****
  
- #ifdef DBM
- typedef struct {
- 	char *dptr;
- 	int dsize;
- } datum;
- #endif /* DBM */
- 
  /*
--- 428,429 ----
***************
*** 478,480 ****
  		*p = 0;
! 		if (strcmp(lbuf, artid) == 0 || strcmp(lbuf, oidbuf) == 0) {
  			(void) fclose(hfp);
--- 479,481 ----
  		*p = 0;
! 		if (STRCMP(lbuf, artid) == 0 || STRCMP(lbuf, oidbuf) == 0) {
  			(void) fclose(hfp);
***************
*** 573,575 ****
  
! #if !defined(BSD4_2) && !defined(BSD4_1C)
  rename(from,to)
--- 574,576 ----
  
! #if !defined(BSD4_2)
  rename(from,to)
***************
*** 584,586 ****
  }
! #endif /* !BSD4_2 && ! BSD4_1C */
  
--- 585,587 ----
  }
! #endif /* !BSD4_2 */
  
***************
*** 666,668 ****
  {
! 	register char *r, *q, *tp;
  	char *tailpath();
--- 667,669 ----
  {
! 	register char *q, *tp;
  	char *tailpath();
Index: header.c
Prereq: 2.48
*** .d/header.c	Wed Oct  7 16:51:57 1987
--- header.c	Wed Oct  7 18:49:03 1987
***************
*** 16,17 ****
--- 16,18 ----
   */
+ /*LINTLIBRARY*/
  
***************
*** 18,20 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)header.c	2.48	3/20/87";
  #endif /* SCCSID */
--- 19,21 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)header.c	2.49	10/7/87";
  #endif /* SCCSID */
***************
*** 149,150 ****
--- 150,152 ----
  #define XPATH		26
+ #define SUPERSEDES	27
  #define OTHER		99
***************
*** 159,161 ****
  	register int	i;
- 	long	curpos;
  
--- 161,162 ----
***************
*** 163,165 ****
  	do {
- 		curpos = ftell(fp);
  		switch (i) {
--- 164,165 ----
***************
*** 220,222 ****
  			getfield(hp->distribution, sizeof(hp->distribution));
! 			if (strcmp(hp->distribution, "net") == 0)
  				hp->distribution[0] = '\0';
--- 220,223 ----
  			getfield(hp->distribution, sizeof(hp->distribution));
! 			if (strcmp(hp->distribution, "net") == 0
! 				|| strcmp(hp->distribution, "world") == 0)
  				hp->distribution[0] = '\0';
***************
*** 242,243 ****
--- 243,247 ----
  			break;
+ 		case SUPERSEDES:
+ 			getfield(hp->supersedes, sizeof(hp->supersedes));
+ 			break;
  		/* discard these lines */
***************
*** 265,268 ****
  
- 	if (*bfr != '\n')
- 		fseek(fp, curpos, 0);
  	if ((hp->from[0] || hp->path[0]) && hp->subdate[0] && hp->ident[0])
--- 269,270 ----
***************
*** 536,538 ****
  
! #define its(type) (prefix(ptr, type))
  type(ptr)
--- 538,540 ----
  
! #define its(type) (PREFIX(ptr, type))
  type(ptr)
***************
*** 564,565 ****
--- 566,568 ----
  		return SUBMIT;
+ #endif /* OLD */
  	if (its("Received: "))
***************
*** 566,568 ****
  		return RECEIVE;
- #endif /* OLD */
  	if (its("Expires: "))
--- 569,570 ----
***************
*** 583,588 ****
  		return FOLLOWTO;
- 	if (its("Posting-Version: "))
- 		return POSTVERSION;
- 	if (its("Relay-Version: "))
- 		return RELAYVERSION;
  	if (its("Distribution: "))
--- 585,586 ----
***************
*** 603,604 ****
--- 601,604 ----
  		return NFFROM;
+ 	if (its("Supersedes: "))
+ 		return SUPERSEDES;
  	if (its("Xref: "))
***************
*** 607,608 ****
--- 607,612 ----
  		return XPATH;
+ 	if (its("Posting-Version: "))
+ 		return POSTVERSION;
+ 	if (its("Relay-Version: "))
+ 		return RELAYVERSION;
  	if (!isalpha(*ptr))
***************
*** 620,621 ****
--- 624,628 ----
   */
+ #ifndef DOXREFS
+ /*ARGSUSED*/
+ #endif /* !DOXREFS */
  ihwrite(hp, fp, wr)
***************
*** 635,637 ****
  	 */
! 	if (prefix(hp->path, PATHSYSNAME) &&
  		index(NETCHRS, hp->path[strlen(PATHSYSNAME)]))
--- 642,644 ----
  	 */
! 	if (PREFIX(hp->path, PATHSYSNAME) &&
  		index(NETCHRS, hp->path[strlen(PATHSYSNAME)]))
***************
*** 691,692 ****
--- 698,701 ----
  		fprintf(fp, "Nf-From: %s\n", hp->nf_from);
+ 	if (*hp->supersedes)
+ 		fprintf(fp, "Supersedes: %s\n", hp->supersedes);
  #ifdef DOXREFS
Index: header.h
Prereq: 2.20
*** .d/header.h	Wed Oct  7 16:52:04 1987
--- header.h	Wed Oct  7 18:49:03 1987
***************
*** 4,6 ****
  
! /*	@(#)header.h	2.20	2/22/87	*/
  
--- 4,6 ----
  
! /*	@(#)header.h	2.21	10/7/87	*/
  
***************
*** 32,33 ****
--- 32,34 ----
  	char	nf_from[BUFLEN];	/* Nf-From:		*/
+ 	char 	supersedes[BUFLEN];	/* Supersedes:		*/
  #ifdef DOXREFS
Index: ifuncs.c
Prereq: 2.65
*** .d/ifuncs.c	Wed Oct  7 16:52:37 1987
--- ifuncs.c	Wed Oct  7 18:49:07 1987
***************
*** 18,20 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)ifuncs.c	2.65	4/10/87";
  #endif /* SCCSID */
--- 18,20 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)ifuncs.c	2.66	10/7/87";
  #endif /* SCCSID */
***************
*** 23,24 ****
--- 23,26 ----
  
+ extern long	localize();
+ 
  /*LINTLIBRARY*/
***************
*** 62,63 ****
--- 64,68 ----
  
+ #ifndef GENERICPATH
+ /*ARGSUSED*/
+ #endif /* !GENERICPATH */
  broadcast(is_rnews)
***************
*** 96,98 ****
  	if (!is_rnews && 
! 		strncmp(PATHSYSNAME, h.path, (len = strlen(PATHSYSNAME))) == 0
  		&& index(NETCHRS, h.path[len]))
--- 101,103 ----
  	if (!is_rnews && 
! 		STRNCMP(PATHSYSNAME, h.path, (len = strlen(PATHSYSNAME))) == 0
  		&& index(NETCHRS, h.path[len]))
***************
*** 115,117 ****
  		char *dist = h.distribution;
! 		if (strncmp(srec.s_name, LOCALPATHSYSNAME, SNLN) == 0)
  			continue;
--- 120,122 ----
  		char *dist = h.distribution;
! 		if (STRNCMP(srec.s_name, LOCALPATHSYSNAME, SNLN) == 0)
  			continue;
***************
*** 128,130 ****
  		while (*hptr != '\0') {
! 			if (strncmp(srec.s_name, hptr, SNLN) == 0)
  				goto contin;
--- 133,135 ----
  		while (*hptr != '\0') {
! 			if (STRNCMP(srec.s_name, hptr, SNLN) == 0)
  				goto contin;
***************
*** 132,134 ****
  				while (*sptr != '\0') {
! 					if (strncmp(sptr, hptr, SNLN) == 0)
  						goto contin;
--- 137,139 ----
  				while (*sptr != '\0') {
! 					if (STRNCMP(sptr, hptr, SNLN) == 0)
  						goto contin;
***************
*** 152,154 ****
  				*sptr = '\0';
! 				if (strcmp(hptr, srec.s_name) == 0) {
  					*sptr = ',';
--- 157,159 ----
  				*sptr = '\0';
! 				if (STRCMP(hptr, srec.s_name) == 0) {
  					*sptr = ',';
***************
*** 160,162 ****
  			}
! 			if (strcmp(hptr, srec.s_name) == 0)
  				continue;
--- 165,167 ----
  			}
! 			if (STRCMP(hptr, srec.s_name) == 0)
  				continue;
***************
*** 173,175 ****
  			for (m = mcast; m < &mcast[mccount]; m++)
! 				if (strcmp(srec.s_xmit, m->mc_name) == 0)
  					break;
--- 178,180 ----
  			for (m = mcast; m < &mcast[mccount]; m++)
! 				if (STRCMP(srec.s_xmit, m->mc_name) == 0)
  					break;
***************
*** 193,195 ****
  			for (m = mcast; m < &mcast[mccount]; m++)
! 				if (strcmp(m->mc_name, srec.s_name) == 0) {
  					yptr = sysptrs;
--- 198,200 ----
  			for (m = mcast; m < &mcast[mccount]; m++)
! 				if (STRCMP(m->mc_name, srec.s_name) == 0) {
  					yptr = sysptrs;
***************
*** 204,206 ****
  #endif /* !VMS */
! 				(strncmp(h.nbuf, "to.", 3) != 0),
  				sysptrs, mc))
--- 209,211 ----
  #endif /* !VMS */
! 				(STRNCMP(h.nbuf, "to.", 3) != 0),
  				sysptrs, mc))
***************
*** 214,216 ****
  #endif /* !VMS */
! 			(strncmp(h.nbuf, "to.", 3) != 0),
  			(char **) NULL, FALSE))
--- 219,221 ----
  #endif /* !VMS */
! 			(STRNCMP(h.nbuf, "to.", 3) != 0),
  			(char **) NULL, FALSE))
***************
*** 297,299 ****
  	*/
! 	if (not_here[0] && strcmp(not_here, sp->s_name) == 0) {
  		(void) fclose(ifp);
--- 302,304 ----
  	*/
! 	if (not_here[0] && STRCMP(not_here, sp->s_name) == 0) {
  		(void) fclose(ifp);
***************
*** 356,358 ****
  				appmsgid ? ".ihave" : "");
! #ifdef IHCC
  		(void) sprintf(TRANS, "%s/%s/%s", logdir(HOME), BATCHDIR, sp->s_xmit);
--- 361,363 ----
  				appmsgid ? ".ihave" : "");
! #ifdef LOGDIR
  		(void) sprintf(TRANS, "%s/%s/%s", logdir(HOME), BATCHDIR, sp->s_xmit);
***************
*** 359,363 ****
  		ofp = fopen(TRANS, "a");
! #else /* !IHCC */
  		ofp = fopen(sp->s_xmit, "a");
! #endif /* !IHCC */
  		if (ofp == NULL)
--- 364,368 ----
  		ofp = fopen(TRANS, "a");
! #else /* !LOGDIR */
  		ofp = fopen(sp->s_xmit, "a");
! #endif /* !LOGDIR */
  		if (ofp == NULL)
***************
*** 516,522 ****
  
- typedef struct {
- 	char *dptr;
- 	int dsize;
- } datum;
- 
  /*
--- 521,522 ----
***************
*** 566,568 ****
  
! 		if (strcmp(bfr, lcident) == 0) {
  			(void) fclose(hfp);
--- 566,568 ----
  
! 		if (STRCMP(bfr, lcident) == 0) {
  			(void) fclose(hfp);
***************
*** 604,606 ****
  #ifndef DBM
! 	if (strcmp((p = histfile(hline)), ARTFILE) != 0) {
  	/* If the history subfile is accessible */
--- 604,606 ----
  #ifndef DBM
! 	if (STRCMP((p = histfile(hline)), ARTFILE) != 0) {
  	/* If the history subfile is accessible */
***************
*** 848,850 ****
  		for (i = 0; i < ngcount; ++i)
! 			if (uses[i] >= 1 && strcmp(bfr, ngs[i]) == 0) {
  				uses[i] = 2;	/* it should be localized too */
--- 848,850 ----
  		for (i = 0; i < ngcount; ++i)
! 			if (uses[i] >= 1 && STRCMP(bfr, ngs[i]) == 0) {
  				uses[i] = 2;	/* it should be localized too */
***************
*** 866,868 ****
  		f = xfopen(ALIASES, "r");
! 		while (okcount < ngcount && fscanf(f, "%s %s", abuf, bfr) == 2)
  			for (i = 0; i < ngcount; ++i) {
--- 866,868 ----
  		f = xfopen(ALIASES, "r");
! 		while (okcount < ngcount && fscanf(f, "%s %s%*[^\n]", abuf, bfr) == 2)
  			for (i = 0; i < ngcount; ++i) {
***************
*** 872,874 ****
  #endif /* ALWAYSALIAS */
! 				if (strcmp(ngs[i], abuf) != 0)
  					continue;
--- 872,874 ----
  #endif /* ALWAYSALIAS */
! 				if (STRCMP(ngs[i], abuf) != 0)
  					continue;
***************
*** 919,921 ****
  				continue;
! 			if (strcmp(ngs[i], ngs[j]) != 0)
  				continue;
--- 919,921 ----
  				continue;
! 			if (STRCMP(ngs[i], ngs[j]) != 0)
  				continue;
***************
*** 1062,1063 ****
--- 1062,1064 ----
  			input_pipe(cmd, "compress", "-d", (char *) 0);
+ 			setbuf(infp, (char *)NULL);
  			continue;	/* look for the #! rnews */
***************
*** 1067,1068 ****
--- 1068,1070 ----
  			input_pipe("/bin/sh", "news-unpack", "-c", cmd);
+ 			setbuf(infp, (char *)NULL);
  			continue;	/* look for the #! rnews */
***************
*** 1074,1076 ****
  			register long size, asize;
! 			char *filename;
  			int pid, wpid, exstat;
--- 1076,1078 ----
  			register long size, asize;
! 			char *tfilename;
  			int pid, wpid, exstat;
***************
*** 1079,1083 ****
  
! 			filename = 0;
  			do {
! 				while (strncmp(cmd, "#! rnews ", 9)) {
  					fprintf(stderr, "out of sync, skipping %s\n", cmd);
--- 1081,1088 ----
  
! 			tfilename = 0;
! 			cp = malloc((unsigned)BUFSIZ);
! 			if (cp != NULL)
! 				setbuf(infp, cp);
  			do {
! 				while (STRNCMP(cmd, "#! rnews ", 9)) {
  					fprintf(stderr, "out of sync, skipping %s\n", cmd);
***************
*** 1102,1108 ****
  							break;	/* fits in buffer */
! 						if (!filename)
! 							filename = mktemp("/tmp/unbnewsXXXXXX");
! 						if ((fd = creat(filename, 0666)) < 0) {
  							fprintf(stderr, "rnews: creat of \"%s\" failed",
! 								filename);
  							perror(" ");
--- 1107,1113 ----
  							break;	/* fits in buffer */
! 						if (!tfilename)
! 							tfilename = mktemp("/tmp/unbnewsXXXXXX");
! 						if ((fd = creat(tfilename, 0666)) < 0) {
  							fprintf(stderr, "rnews: creat of \"%s\" failed",
! 								tfilename);
  							perror(" ");
***************
*** 1114,1116 ****
  						fprintf(stderr, "write of %d to \"%s\" returned %d",
! 							rc, filename, wc);
  						perror(" ");
--- 1119,1121 ----
  						fprintf(stderr, "write of %d to \"%s\" returned %d",
! 							rc, tfilename, wc);
  						perror(" ");
***************
*** 1166,1168 ****
  						 * input */
! 						freopen(filename, "r", infp);
  					return;	/* from checkbatch as if
--- 1171,1173 ----
  						 * input */
! 						freopen(tfilename, "r", infp);
  					return;	/* from checkbatch as if
***************
*** 1184,1187 ****
  				while ((wpid = wait(&exstat)) >= 0 && wpid != pid);
  			} while (fgets(cmd, BUFLEN, infp) != NULL);
- 			(void) unlink(filename);
  			exit(0);/* all done */
--- 1189,1192 ----
  				while ((wpid = wait(&exstat)) >= 0 && wpid != pid);
+ 				(void) unlink(tfilename);
  			} while (fgets(cmd, BUFLEN, infp) != NULL);
  			exit(0);/* all done */
***************
*** 1399,1401 ****
  	if (LockFd < 0)
! 		logerr("Can't open(\"%s\",2) to lock", SUBFILE);
  	/* This will sleep until the other program releases the lock */
--- 1404,1406 ----
  	if (LockFd < 0)
! 		logerr("Can't open(\"%s\", 2) to lock", SUBFILE);
  	/* This will sleep until the other program releases the lock */
***************
*** 1403,1407 ****
  #ifdef LOCKF
! 	if (lockf(LockFd, F_LOCK, 0) < 0)
  #else
! 	 if (flock(LockFd, LOCK_EX) < 0)
  #endif
--- 1408,1412 ----
  #ifdef LOCKF
! 	if (lockf(LockFd, F_LOCK, 0L) < 0)
  #else
! 	if (flock(LockFd, LOCK_EX) < 0)
  #endif
Index: inews.c
Prereq: 2.80
*** .d/inews.c	Wed Oct  7 16:52:59 1987
--- inews.c	Wed Oct  7 18:49:10 1987
***************
*** 19,21 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)inews.c	2.80	4/10/87";
  #endif /* SCCSID */
--- 19,21 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)inews.c	2.81	10/7/87";
  #endif /* SCCSID */
***************
*** 34,36 ****
  #ifdef BSD4_2
- # include <sys/dir.h>
  # include <sys/file.h>
--- 34,35 ----
***************
*** 37,39 ****
  #else	/* !BSD4_2 */
- # include "ndir.h"
  # if defined(USG) && !defined(LOCKF)
--- 36,37 ----
***************
*** 127,129 ****
  
! 	/* uuxqt doesn't close all it's files */
  	for (i = 3; !close(i); i++)
--- 125,127 ----
  
! 	/* uuxqt doesn't close all its files */
  	for (i = 3; !close(i); i++)
***************
*** 144,146 ****
  # else /* !F_RDLCK */
! 	if (lockf(fileno(actfp), F_TLOCK, 0) < 0) {
  # endif /* !F_RDLCK */
--- 142,144 ----
  # else /* !F_RDLCK */
! 	if (lockf(fileno(actfp), F_TLOCK, 0L) < 0) {
  # endif /* !F_RDLCK */
***************
*** 173,175 ****
  #ifdef	LOCKF
! 		(void) lockf(fileno(actfp), F_ULOCK, 0);
  #else	/* !LOCKF */
--- 171,173 ----
  #ifdef	LOCKF
! 		(void) lockf(fileno(actfp), F_ULOCK, 0L);
  #else	/* !LOCKF */
***************
*** 193,195 ****
  
! 	if (!strncmp(ptr+1, "rnews", 5)) {
  		mode = PROC;
--- 191,193 ----
  
! 	if (!STRNCMP(ptr+1, "rnews", 5)) {
  		mode = PROC;
***************
*** 228,229 ****
--- 226,234 ----
  	}
+ 	/*
+ 	 * Catch "filesize exceeded" signals on 4.2BSD systems
+ 	 * - the history files may exceed this limit.
+ 	 */
+ #ifdef  SIGXFSZ
+ 	(void) signal(SIGXFSZ, SIG_IGN);
+ #endif /* SIGXFSZ */
  	uid = getuid();
***************
*** 250,253 ****
  
  	/*
! 	 * IHCC forces the use of 'getuser()' to prevent forgery of articles
  	 * by just changing $LOGNAME
--- 255,259 ----
  
+ #ifndef DOGETUSER
  	/*
! 	 * Force the use of 'getuser()' to prevent forgery of articles
  	 * by just changing $LOGNAME
***************
*** 254,256 ****
  	 */
- #ifndef IHCC 
  	if (isatty(fileno(stderr))) {
--- 260,261 ----
***************
*** 261,263 ****
  	}
! #endif /* !IHCC */
  	if (user == NULL || home == NULL)
--- 266,268 ----
  	}
! #endif /* !DOGETUSER */
  	if (user == NULL || home == NULL)
***************
*** 265,267 ****
  	else {
! 		if (username == NULL || username[0] == 0) {
  			username = AllocCpy(user);
--- 270,272 ----
  	else {
! 		if (STRCMP(username, "Unknown") == 0 || username[0] == 0) {
  			username = AllocCpy(user);
***************
*** 367,369 ****
  			if (header.from[0]) {
! 				(void) fixfrom(header.from);
  				if (Sflag && !Mflag && !header.approved[0] &
--- 372,374 ----
  			if (header.from[0]) {
! 				(void) fixfrom(&header);
  				if (Sflag && !Mflag && !header.approved[0] &
***************
*** 403,405 ****
  
! 				if ((p1 = strpbrk(header.path, "@ (<")) != NULL)
  					*p1 = '\0';
--- 408,410 ----
  
! 				if ((p1 = strpbrk(header.path, " (<")) != NULL)
  					*p1 = '\0';
***************
*** 421,423 ****
  			strncpy(header.organization, MYORG, BUFLEN);
! 			if (strncmp(header.organization, "Frobozz", 7) == 0)
  				header.organization[0] = '\0';
--- 426,428 ----
  			strncpy(header.organization, MYORG, BUFLEN);
! 			if (STRNCMP(header.organization, "Frobozz", 7) == 0)
  				header.organization[0] = '\0';
***************
*** 436,438 ****
  				} else {
- 					header.organization[0] = '\0';
  					logerr("Couldn't open %s",
--- 441,442 ----
***************
*** 439,440 ****
--- 443,445 ----
  						header.organization);
+ 					header.organization[0] = '\0';
  				}
***************
*** 457,459 ****
  			xerror("%s: Inbound news is garbled", filename);
! 		input();
  	}
--- 462,464 ----
  			xerror("%s: Inbound news is garbled", filename);
! 		input(bfr[0] != '\n');
  	}
***************
*** 468,470 ****
  	/* Easy way to make control messages, since all.all.ctl is unblessed */
! 	if (mode != PROC && prefix(header.title, "cmsg ") && header.ctlmsg[0] == 0)
  		(void) strcpy(header.ctlmsg, &header.title[5]);
--- 473,475 ----
  	/* Easy way to make control messages, since all.all.ctl is unblessed */
! 	if (mode != PROC && PREFIX(header.title, "cmsg ") && header.ctlmsg[0] == 0)
  		(void) strcpy(header.ctlmsg, &header.title[5]);
***************
*** 486,490 ****
  #ifdef FASCIST
! 		if (uid && uid != ROOTID && fascist(user, header.nbuf))
  			xerror("User %s is not authorized to post to newsgroup %s",
! 				user, header.nbuf);
  #endif /* FASCIST */
--- 491,495 ----
  #ifdef FASCIST
! 		if (uid && uid != ROOTID && fascist(username, header.nbuf))
  			xerror("User %s is not authorized to post to newsgroup %s",
! 				username, header.nbuf);
  #endif /* FASCIST */
***************
*** 498,500 ****
  	if (mode != PROC)
! 		input();
  	if (header.intnumlines == 0 && !is_ctl)
--- 503,505 ----
  	if (mode != PROC)
! 		input(FALSE);
  	if (header.intnumlines == 0 && !is_ctl)
***************
*** 647,648 ****
--- 652,658 ----
  		tp->tm_hour, tp->tm_min, getpid());
+ 
+ #ifdef IHCC
+ 	log("Spooling %s into %s", header.ident, (rindex(buf,'/') + 1));
+ #endif /* IHCC */
+ 
  	if (LINK(sfile, buf) < 0) {
***************
*** 731,735 ****
  		}
! 		if (prefix(afline, ngname)) {
  			(void) sscanf(afline, "%s %ld", bfr, &ngsize);
! 			if (strcmp(bfr, ngname) == 0) {
  				if (ngsize < 0 || ngsize > 99998) {
--- 741,745 ----
  		}
! 		if (PREFIX(afline, ngname)) {
  			(void) sscanf(afline, "%s %ld", bfr, &ngsize);
! 			if (STRCMP(bfr, ngname) == 0) {
  				if (ngsize < 0 || ngsize > 99998) {
***************
*** 873,875 ****
  #ifdef ZAPNOTES
! 	if (strncmp(header.title, "Re: Orphaned Response", 21) == 0) {
  		logerr("Orphaned Response, moved to junk");
--- 883,885 ----
  #ifdef ZAPNOTES
! 	if (STRNCMP(header.title, "Re: Orphaned Response", 21) == 0) {
  		logerr("Orphaned Response, moved to junk");
***************
*** 916,918 ****
  					LIB);
! 		} while (strcmp(bfr, "backbone") != 0 && !ngmatch(is_mod, bfr));
  		(void) fclose(mfd);
--- 926,928 ----
  					LIB);
! 		} while (STRCMP(bfr, "backbone") != 0 && !ngmatch(is_mod, bfr));
  		(void) fclose(mfd);
***************
*** 929,931 ****
  			xerror("Can't send mail to %s", mhdr.path);
! 		fprintf(mfd, "To: %s\n", replyname(mhdr.path));
  		lhwrite(&header, mfd);
--- 939,941 ----
  			xerror("Can't send mail to %s", mhdr.path);
! 		fprintf(mfd, "To: %s\n", replyname(&mhdr));
  		lhwrite(&header, mfd);
***************
*** 1033,1034 ****
--- 1043,1051 ----
  		savehist(histline);
+ 		if (header.supersedes[0] != '\0') {
+ 			char *av[2];
+ 
+ 			av[0] = "cancel";
+ 			av[1] = header.supersedes;
+ 			c_cancel(2, av);
+ 		}
  		broadcast(mode==PROC);
***************
*** 1039,1041 ****
  
! input()
  {
--- 1056,1058 ----
  
! input(usegunk)
  {
***************
*** 1050,1052 ****
  	tmpfp = xfopen(mktemp(INFILE), "w");
! 	while (!SigTrap && fgets(bfr, BUFLEN, infp) != NULL) {
   		if (mode == PROC) {	/* zap trailing empty lines */
--- 1067,1075 ----
  	tmpfp = xfopen(mktemp(INFILE), "w");
! 	for ( ; ; ) {
! 		if (SigTrap)
! 			break;
! 		if (usegunk)
! 			usegunk = FALSE;
! 		else if (fgets(bfr, BUFLEN, infp) != bfr)
! 			break;
   		if (mode == PROC) {	/* zap trailing empty lines */
***************
*** 1089,1091 ****
   		}
! 		if (mode != PROC && tty && strcmp(bfr, ".\n") == 0)
  			break;
--- 1112,1114 ----
   		}
! 		if (mode != PROC && tty && STRCMP(bfr, ".\n") == 0)
  			break;
***************
*** 1202,1203 ****
--- 1225,1233 ----
  {
+ #ifdef USG
+ 	register char *p;
+ 	char parent[200];
+ 	char sysbuf[200];
+ 	struct stat sbuf;
+ #endif /* USG */
+ 
  	if (ngname == NULL || !isalpha(ngname[0]))
***************
*** 1205,1206 ****
--- 1235,1252 ----
  
+ #ifdef USG
+ 	/*
+ 	 * If the parent is 755 the setuid(getuid)
+ 	 * will fail, and since mkdir is suid, and our real uid is random,
+ 	 * the mkdir will fail.  So we have to temporarily chmod it to 777.
+ 	 */
+ 	(void) strcpy(parent, fulldir);
+ 	while (p = rindex(parent, '/')) {
+ 		*p = '\0';
+ 		if (stat(parent, &sbuf) == 0) {
+ 			(void) chmod(parent, 0777);
+ 			break;
+ 		}
+ 	}
+ #endif /* USG */
+ 
  	/* Create the directory */
***************
*** 1207,1209 ****
  	mkparents(fulldir);
- 
  	if (mkdir(fulldir, 0777) < 0)
--- 1253,1254 ----
***************
*** 1211,1212 ****
--- 1256,1277 ----
  
+ #ifdef USG
+ 	/*
+ 	 * Give away the directories we just created which were assigned
+ 	 * our real uid.
+ 	 */
+ 	(void) setuid(uid);
+ 	(void) chown(fulldir, duid, dgid);
+ 
+ 	(void) strcpy(sysbuf, fulldir);
+ 	while (p = rindex(sysbuf, '/')) {
+ 		*p = '\0';
+ 		/* stop when get to last known good parent */
+ 		if (strcmp(sysbuf, parent) == 0)
+ 			break;
+ 		(void) chown(sysbuf, duid, dgid);
+ 	}
+ 	(void) setuid(duid);
+ 	(void) chmod(parent, (int)sbuf.st_mode);	/* put it back */
+ #endif /* USG */
+ 
  	log("make newsgroup %s in dir %s", ngname, fulldir);
***************
*** 1234,1251 ****
  
- cancel()
- {
- 	register FILE *fp;
- 
- 	log("cancel article %s", filename);
- 	fp = fopen(filename, "r");
- 	if (fp == NULL) {
- 		log("article %s not found", filename);
- 		return;
- 	}
- 	if (hread(&header, fp, TRUE) == NULL)
- 		error("Article is garbled.");
- 	(void) fclose(fp);
- 	(void) unlink(filename);
- }
- 
  dounspool()
--- 1299,1300 ----
***************
*** 1274,1276 ****
  	LockFd = xfopen(SEQFILE, "r+w");
! 	if (lockf(fileno(LockFd), F_TLOCK, 0) < 0) {
  		if (errno != EAGAIN && errno != EACCES)
--- 1323,1325 ----
  	LockFd = xfopen(SEQFILE, "r+w");
! 	if (lockf(fileno(LockFd), F_TLOCK, 0L) < 0) {
  		if (errno != EAGAIN && errno != EACCES)
***************
*** 1302,1303 ****
--- 1351,1357 ----
  				continue;
+ 
+ #ifdef IHCC
+ 			log("Unspooling from %s", dir->d_name);
+ #endif /* IHCC */
+ 
  			if ((pid=vfork()) == -1)
***************
*** 1305,1307 ****
  			if (pid == 0) {
! #ifdef IHCC
  				char bufr[BUFSIZ];
--- 1359,1361 ----
  			if (pid == 0) {
! #ifdef LOGDIR
  				char bufr[BUFSIZ];
***************
*** 1310,1312 ****
  					(char *) NULL);
! #else /* !IHCC */
  				execl(RNEWS, "rnews", "-S", "-p", dir->d_name,
--- 1364,1366 ----
  					(char *) NULL);
! #else /* !LOGDIR */
  				execl(RNEWS, "rnews", "-S", "-p", dir->d_name,
***************
*** 1313,1315 ****
  					(char *) NULL);
! #endif /* !IHCC */
  				_exit(1);
--- 1367,1369 ----
  					(char *) NULL);
! #endif /* !LOGDIR */
  				_exit(1);
***************
*** 1328,1331 ****
  				(void) LINK(dir->d_name, bfr);
! 				logerr("rnews failed, status %d. Batch saved in %s/%s",
! 					status, SPOOL, dir->d_name);
  			}
--- 1382,1385 ----
  				(void) LINK(dir->d_name, bfr);
! 				logerr("rnews failed, status %ld. Batch saved in %s/%s",
! 					(long)status, SPOOL, dir->d_name);
  			}
***************
*** 1336,1338 ****
--- 1390,1396 ----
  	} while (foundsome); /* keep rereading the directory until it's empty */
+ #ifndef LOCKF
+ #ifndef BSD4_2
  	(void) UNLINK(spbuf);
+ #endif
+ #endif
  
Index: ndir.h
Prereq: 1.6
*** .d/ndir.h	Wed Oct  7 16:53:38 1987
--- ndir.h	Wed Oct  7 18:49:10 1987
***************
*** 1,2 ****
! /* @(#)ndir.h	1.6	3/9/87	*/
  #if defined(HP9K5)
--- 1,2 ----
! /*	@(#)ndir.h	1.7	10/7/87	*/
  #if defined(HP9K5)
***************
*** 3,5 ****
  /* He should have included it instead of this, but prevent confusion */
! #include <sys/ndir.h>
  #else /* other */
--- 3,5 ----
  /* He should have included it instead of this, but prevent confusion */
! #include <ndir.h>
  #else /* other */
Index: params.h
Prereq: 2.23
*** .d/params.h	Wed Oct  7 16:53:41 1987
--- params.h	Wed Oct  7 18:49:11 1987
***************
*** 4,6 ****
  
! /*	@(#)params.h	2.23	4/6/87	*/
  
--- 4,6 ----
  
! /*	@(#)params.h	2.24	10/7/87	*/
  
***************
*** 125 ****
--- 125,160 ----
  #endif
+ 
+ #ifdef M_XENIX
+ /* fake SVID adivsory locking with xenix routines */
+ #define lockf	locking
+ #define F_ULOCK	0
+ #define F_LOCK	3
+ #define F_TLOCK	4
+ #endif /* M_XENIX */
+ 
+ #ifdef IHCC
+ #define DOGETUSERS
+ #define LOGDIR
+ #endif /* IHCC */
+ 
+ #ifdef BSD4_2
+ #define MKDIR_SUB
+ #define READDIR
+ #endif /* BSD4_2 */
+ 
+ #ifdef READDIR
+ #include <sys/dir.h>
+ #else /* !READDIR */
+ #include "ndir.h"
+ #endif /* !READDIR */
+ 
+ #if defined(DBM) && !defined(M_XENIX)
+ typedef struct {
+ 	char *dptr;
+ 	int dsize;
+ } datum;
+ #endif /* DBM &! XENIX */
+ 
+ #define STRCMP(a,b)  ((*(a) != *(b)) ? (*(a)-*(b)) : strcmp((a)+1, (b)+1))
+ #define STRNCMP(a,b,n)  ((*(a) != *(b)) ? (*(a)-*(b)) : strncmp(a, b, n))
+ #define PREFIX(a,b)  ((*(a) != *(b)) ? FALSE : prefix((a)+1, (b)+1))
Index: pathinit.c
Prereq: 1.23
*** .d/pathinit.c	Wed Oct  7 16:53:49 1987
--- pathinit.c	Wed Oct  7 18:49:13 1987
***************
*** 36,38 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)pathinit.c	1.23	4/6/87";
  #endif /* SCCSID */
--- 36,38 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)pathinit.c	1.24	10/7/87";
  #endif /* SCCSID */
***************
*** 54,56 ****
  char *SPOOL, *LIB, *BIN, *ACTIVE, *SUBFILE, *ARTFILE,
! 	*username, *userhome;
  
--- 54,56 ----
  char *SPOOL, *LIB, *BIN, *ACTIVE, *SUBFILE, *ARTFILE,
! 	*username = "Unknown", *userhome;
  
***************
*** 128,130 ****
  	/* old compatibility code, remove when HIDDENNET is used no more */
! 	if (strcmp(ubuf.nodename, HIDDENNET) != 0)
  		(void) sprintf(buf, "%s.%s%s", ubuf.nodename, HIDDENNET,
--- 128,130 ----
  	/* old compatibility code, remove when HIDDENNET is used no more */
! 	if (STRCMP(ubuf.nodename, HIDDENNET) != 0)
  		(void) sprintf(buf, "%s.%s%s", ubuf.nodename, HIDDENNET,
***************
*** 166,168 ****
  
! #ifdef IHCC
  	(void) sprintf(bfr, "%s/%s", logdir(HOME), BINDIR);
--- 166,168 ----
  
! #ifdef LOGDIR
  	(void) sprintf(bfr, "%s/%s", logdir(HOME), BINDIR);
***************
*** 169,173 ****
  	BIN = AllocCpy(bfr);
! #else /* !IHCC */
  	Sprintf(BIN, "%s", BINDIR);
! #endif /* !IHCC */
  
--- 169,173 ----
  	BIN = AllocCpy(bfr);
! #else /* !LOGDIR */
  	Sprintf(BIN, "%s", BINDIR);
! #endif /* !LOGDIR */
  
***************
*** 303,305 ****
  	 */
! 	if(strcmp(what, "all") == 0) {
  		for(mp=msgtype; mp->m_name; mp++) {
--- 303,305 ----
  	 */
! 	if(STRCMP(what, "all") == 0) {
  		for(mp=msgtype; mp->m_name; mp++) {
***************
*** 314,316 ****
  	for(mp=msgtype; mp->m_name; mp++)
! 		if(strcmp(mp->m_name, what) == 0) {
  			mp->m_who_to = AllocCpy(to);
--- 314,316 ----
  	for(mp=msgtype; mp->m_name; mp++)
! 		if(STRCMP(mp->m_name, what) == 0) {
  			mp->m_who_to = AllocCpy(to);
Index: postnews.c
Prereq: 1.31
*** .d/postnews.c	Wed Oct  7 16:54:01 1987
--- postnews.c	Wed Oct  7 18:49:17 1987
***************
*** 19,21 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)postnews.c	1.31	3/21/87";
  #endif /* SCCSID */
--- 19,21 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)postnews.c	1.32	10/7/87";
  #endif /* SCCSID */
***************
*** 24,25 ****
--- 24,28 ----
  
+ # ifndef ROOTID
+ extern int ROOTID;
+ # endif
  #define APPEND 1
***************
*** 69,71 ****
  	if (argc == 2) {
! 		if (!prefix(argv[1], SPOOL))
  			xerror("Can only followup to articles in %s", SPOOL);
--- 72,74 ----
  	if (argc == 2) {
! 		if (!PREFIX(argv[1], SPOOL))
  			xerror("Can only followup to articles in %s", SPOOL);
***************
*** 171,177 ****
  #ifdef PAGE
! # ifdef IHCC
  					(void) sprintf(lbuf,"%s/bin/%s", logdir(HOME), PAGE);
! # else /* !IHCC */
  					(void) strcpy(lbuf, PAGE);
! # endif /* !IHCC */
  					pager = lbuf;
--- 174,180 ----
  #ifdef PAGE
! # ifdef LOGDIR
  					(void) sprintf(lbuf,"%s/bin/%s", logdir(HOME), PAGE);
! # else /* !LOGDIR */
  					(void) strcpy(lbuf, PAGE);
! # endif /* !LOGDIR */
  					pager = lbuf;
***************
*** 247,253 ****
  #ifdef PAGE
! # ifdef IHCC
  				(void) sprintf(lbuf,"%s/bin/%s", logdir(HOME), PAGE);
! # else /* !IHCC */
  				(void) strcpy(lbuf, PAGE);
! # endif /* !IHCC */
  				pager = lbuf;
--- 250,256 ----
  #ifdef PAGE
! # ifdef LOGDIR
  				(void) sprintf(lbuf,"%s/bin/%s", logdir(HOME), PAGE);
! # else /* !LOGDIR */
  				(void) strcpy(lbuf, PAGE);
! # endif /* !LOGDIR */
  				pager = lbuf;
***************
*** 296,298 ****
  		*r = '\0';
! 		if (strcmp(def, "net") == 0)
  			(void) strcpy(def, "world");
--- 299,301 ----
  		*r = '\0';
! 		if (STRCMP(def, "net") == 0)
  			(void) strcpy(def, "world");
***************
*** 303,305 ****
  
! 	if (strcmp(def, "to") == 0) {
  		/*
--- 306,308 ----
  
! 	if (STRCMP(def, "to") == 0) {
  		/*
***************
*** 317,319 ****
  	for (i=0; distr[i].abbr[0]; i++) {
! 		if (strcmp(distr[i].abbr, def) == 0)
  			break;
--- 320,322 ----
  	for (i=0; distr[i].abbr[0]; i++) {
! 		if (STRCMP(distr[i].abbr, def) == 0)
  			break;
***************
*** 327,329 ****
  			if (distribution[0] == '\0') {
! 				if (strcmp(def, "*None*") == 0)
  					printf("You must enter a distribution, '?' for help.\n");
--- 330,332 ----
  			if (distribution[0] == '\0') {
! 				if (STRCMP(def, "*None*") == 0)
  					printf("You must enter a distribution, '?' for help.\n");
***************
*** 331,333 ****
  			}
! 		} while (strcmp(distribution, "*None*") == 0);
  
--- 334,336 ----
  			}
! 		} while (STRCMP(distribution, "*None*") == 0);
  
***************
*** 348,350 ****
  		}
! 		if (strcmp(distribution, def) != 0)
  			printf("Type ? for help.\n");
--- 351,353 ----
  		}
! 		if (STRCMP(distribution, def) != 0)
  			printf("Type ? for help.\n");
***************
*** 356,358 ****
  				while (r = index(r, NGDELIM))
! 					if (!prefix(++r, def))
  						break;
--- 359,361 ----
  				while (r = index(r, NGDELIM))
! 					if (!PREFIX(++r, def))
  						break;
***************
*** 379,381 ****
  			*r = '\0';
! 			if (strcmp(def, "net") == 0)
  				strcpy(def, "world");
--- 382,384 ----
  			*r = '\0';
! 			if (STRCMP(def, "net") == 0)
  				strcpy(def, "world");
***************
*** 410,412 ****
  	fprintf(tf, "Newsgroups: %s\n", newsgroups);
! 	if (distribution[0] != '\0' && strcmp(distribution, "world"))
  		fprintf(tf, "Distribution: %s\n", distribution);
--- 413,415 ----
  	fprintf(tf, "Newsgroups: %s\n", newsgroups);
! 	if (distribution[0] != '\0' && STRCMP(distribution, "world"))
  		fprintf(tf, "Distribution: %s\n", distribution);
***************
*** 455,457 ****
  	p = editor + strlen(editor) - 2;
! 	if (strcmp(p, "vi") == 0)
  		endflag = "+";
--- 458,460 ----
  	p = editor + strlen(editor) - 2;
! 	if (STRCMP(p, "vi") == 0)
  		endflag = "+";
***************
*** 550,552 ****
  
! 	if (ngmatch(newsgroups, "comp.sources.all,!comp.sources.wanted")) {
  		if (!article_line(tempfname, "Subject: ", group)) {
--- 553,555 ----
  
! 	if (ngmatch(newsgroups, "comp.sources.all,!comp.sources.wanted,!comp.sources.d")) {
  		if (!article_line(tempfname, "Subject: ", group)) {
***************
*** 600,602 ****
  
! 	if (prefix(str, "Re:"))
  		return (FALSE);
--- 603,605 ----
  
! 	if (PREFIX(str, "Re:"))
  		return (FALSE);
***************
*** 745,747 ****
  			break;
! 		if (strcmp(distr[i].abbr, "default") == 0)
  			strcpy(def_distr, distr[i--].descr);
--- 748,750 ----
  			break;
! 		if (STRCMP(distr[i].abbr, "default") == 0)
  			strcpy(def_distr, distr[i--].descr);
***************
*** 839,841 ****
  	while (fgets(lbfr, BUFLEN, fpart) != NULL) {
! 		if (prefix(lbfr, field)) {
  			found = TRUE;
--- 842,844 ----
  	while (fgets(lbfr, BUFLEN, fpart) != NULL) {
! 		if (PREFIX(lbfr, field)) {
  			found = TRUE;
***************
*** 896,898 ****
  			
! 		if (strcmp(ng_check, ng) == 0) {
  			(void) fclose(fp);
--- 899,901 ----
  			
! 		if (STRCMP(ng_check, ng) == 0) {
  			(void) fclose(fp);
***************
*** 925,927 ****
  	fp = xfopen(article,"r");
! 	while ((c=fgets(line,BUFLEN,fp)) != NULL && !prefix(line, field))
  		if (line[0] == '\n') {
--- 928,930 ----
  	fp = xfopen(article,"r");
! 	while ((c=fgets(line,BUFLEN,fp)) != NULL && !PREFIX(line, field))
  		if (line[0] == '\n') {
***************
*** 969,974 ****
  		(void) strcpy(newsgroups, buf+12);
! 	if (ngmatch(newsgroups, "misc.jobs")) {
! 		printf("misc.jobs is for the direct posting of job announcements and requests.\n");
! 		printf("it is not for discussion. You followup has been directed to misc.misc\n");
! 		(void) strcpy(newsgroups,"misc.misc");
  	}
--- 972,977 ----
  		(void) strcpy(newsgroups, buf+12);
! 	if (ngmatch(newsgroups, "misc.jobs.all,!misc.jobs.misc")) {
! 		printf("Your followup has been directed to misc.jobs.misc\n");
! 		printf("It is the proper place for followup discussions\n");
! 		(void) strcpy(newsgroups,"misc.jobs.misc");
  	}
***************
*** 1005,1007 ****
  		(void) strcpy(newsgroups, buf+13);
! 		if (strcmp(newsgroups, "poster") == 0)
  			byebye("Mail followups directly to poster.");
--- 1008,1010 ----
  		(void) strcpy(newsgroups, buf+13);
! 		if (STRCMP(newsgroups, "poster") == 0)
  			byebye("Mail followups directly to poster.");
***************
*** 1104,1107 ****
  				putc(c, stderr);
  			fprintf(stderr, "Do you understand this?  Hit <return> to proceed, <BREAK> to abort: ");
! 			n = read(2, recbuf, 100);
  			c = recbuf[0];
--- 1107,1112 ----
  				putc(c, stderr);
+ 			fclose(fd);
  			fprintf(stderr, "Do you understand this?  Hit <return> to proceed, <BREAK> to abort: ");
! 			fflush(stderr);
! 			n = read(0, recbuf, 100);
  			c = recbuf[0];
***************
*** 1120,1122 ****
  
! #if !defined(BSD4_2) && !defined(BSD4_1C)
  rename(from,to)
--- 1125,1127 ----
  
! #if !defined(BSD4_2)
  rename(from,to)
Index: sendbatch.sh
Prereq: 1.11
*** .d/sendbatch.sh	Wed Oct  7 16:54:54 1987
--- sendbatch.sh	Wed Oct  7 18:49:17 1987
***************
*** 1,2 ****
! : '@(#)sendbatch.sh	1.11	9/24/87'
  
--- 1,2 ----
! : '@(#)sendbatch.sh	1.12	10/7/87'
  
***************
*** 43,46 ****
  	: make sure $? is zero
! 	testit="-s BATCHDIR/$rmt -o "
! 	while test $? -eq 0 -a \( $testit -s /usr/spool/batch/$rmt.work -o  \( -n "$DOIHAVE" -a -s /usr/spool/batch/$rmt.ihave \) \)
  	do
--- 43,46 ----
  	: make sure $? is zero
! 	testit="yes"
! 	while test $? -eq 0 -a \( \( -n "$testit" -s BATCHDIR/$rmt \) -o -s BATCHDIR/$rmt.work -o  \( -n "$DOIHAVE" -a -s BATCHDIR/$rmt.ihave \) \)
  	do
Index: rfuncs.c
Prereq: 2.40
*** .d/rfuncs.c	Wed Oct  7 16:54:45 1987
--- rfuncs.c	Wed Oct  7 18:49:19 1987
***************
*** 18,20 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)rfuncs.c	2.40	2/22/87";
  #endif /* SCCSID */
--- 18,20 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)rfuncs.c	2.41	10/7/87";
  #endif /* SCCSID */
***************
*** 93,95 ****
  	last = 1;
! 	if (strcmp(name, bfr)) {
  		af = xfopen(ACTIVE, "r");
--- 93,95 ----
  	last = 1;
! 	if (STRCMP(name, bfr)) {
  		af = xfopen(ACTIVE, "r");
***************
*** 97,99 ****
  			if (sscanf(buf, "%s %ld %ld", n, &s, &sm) == 3 &&
! 			     strcmp(n, name) == 0) {
  				ngsize = s;
--- 97,99 ----
  			if (sscanf(buf, "%s %ld %ld", n, &s, &sm) == 3 &&
! 			     STRCMP(n, name) == 0) {
  				ngsize = s;
***************
*** 247,249 ****
  	register char	*ptr, *fname;
! 	int	news = 0;
  	register int i;
--- 247,249 ----
  	register char	*ptr, *fname;
! 	int	isnews = FALSE;
  	register int i;
***************
*** 299,301 ****
  			putc('\n', ofp);
! 			news = TRUE;
  			(void) fclose(fp);
--- 299,301 ----
  			putc('\n', ofp);
! 			isnews = TRUE;
  			(void) fclose(fp);
***************
*** 306,308 ****
  	(void) fclose(ofp);
! 	if (!news) {
  		fprintf(stderr, "No news.\n");
--- 306,308 ----
  	(void) fclose(ofp);
! 	if (!isnews) {
  		fprintf(stderr, "No news.\n");
***************
*** 333,335 ****
  			*ptr = 0;
! 			if (strcmp(bfr, groupdir))
  				continue;
--- 333,335 ----
  			*ptr = 0;
! 			if (STRCMP(bfr, groupdir))
  				continue;
***************
*** 472,474 ****
  		return FALSE;
! 	if (fflag && (hp->followid[0] || prefix(hp->title, "Re:")))
  		return FALSE;
--- 472,474 ----
  		return FALSE;
! 	if (fflag && (hp->followid[0] || PREFIX(hp->title, "Re:")))
  		return FALSE;
***************
*** 499,501 ****
  		}
! 		if (strcmp(g, groupdir) == 0)
  			return flag;
--- 499,501 ----
  		}
! 		if (STRCMP(g, groupdir) == 0)
  			return flag;
***************
*** 569,571 ****
  		if (lentab[i] == len && rcline[i] != NULL &&
! 			strncmp(name, rcline[i], len) == 0)
  			return prev = i;
--- 569,571 ----
  		if (lentab[i] == len && rcline[i] != NULL &&
! 			STRNCMP(name, rcline[i], len) == 0)
  			return prev = i;
***************
*** 683,685 ****
  		while (++lastline < tp->rcindex) {
! 			if (strncmp(rcline[lastline], "options ", 8) == 0) {
  				fprintf(nfp, "%s\n", rcline[lastline]);
--- 683,685 ----
  		while (++lastline < tp->rcindex) {
! 			if (STRNCMP(rcline[lastline], "options ", 8) == 0) {
  				fprintf(nfp, "%s\n", rcline[lastline]);
***************
*** 706,712 ****
  
- #if defined(BSD4_2) || defined(BSD4_1C)
- #include <sys/dir.h>
- # else
- #include "ndir.h"
- #endif
  #include <errno.h>
--- 706,707 ----
***************
*** 713,714 ****
--- 708,718 ----
  
+ #ifdef SMALL_ADDRESS_SPACE
+ list_group(lgroup, displines, flag, pngsize)
+ char *lgroup;
+ int displines, flag;
+ long pngsize;
+ {
+ 	printf("Not enough memory on your machine to include this function.\n");}
+ #else /* !SMALL_ADDRESS_SPACE */
+ 
  /*
***************
*** 768,770 ****
  		if (flag == FALSE) {
! 			if (get(i) == 0)
  				continue;
--- 772,774 ----
  		if (flag == FALSE) {
! 			if (get((long)i) == 0)
  				continue;
***************
*** 845 ****
--- 849,850 ----
  }
+ #endif /* !SMALL_ADDRESS_SPACE */
Index: readr.c
Prereq: 2.61
*** .d/readr.c	Wed Oct  7 16:54:20 1987
--- readr.c	Wed Oct  7 18:49:22 1987
***************
*** 18,20 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)readr.c	2.61	3/21/87";
  #endif /* SCCSID */
--- 18,20 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)readr.c	2.62	10/7/87";
  #endif /* SCCSID */
***************
*** 22,28 ****
  #include "rparams.h"
- #if defined(BSD4_2) || defined(BSD4_1C)
- #include <sys/dir.h>
- #else
- #include "ndir.h"
- #endif /* !BSD4_2 && !BSD4_1C */
  #include <setjmp.h>
--- 22,23 ----
***************
*** 394,396 ****
  		obit = bit;
! 		if (strcmp(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
--- 389,391 ----
  		obit = bit;
! 		if (STRCMP(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
***************
*** 528,530 ****
  		if (!ptr2) {
! 			if (strcmp(ptr3, "cancelled") == 0) {
  				fprintf(ofp, "Article %s has been cancelled.\n",
--- 523,525 ----
  		if (!ptr2) {
! 			if (STRCMP(ptr3, "cancelled") == 0) {
  				fprintf(ofp, "Article %s has been cancelled.\n",
***************
*** 547,549 ****
  		(void) strcpy(ogroupdir, ptr3);
! 		if (strcmp(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
--- 542,544 ----
  		(void) strcpy(ogroupdir, ptr3);
! 		if (STRCMP(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
***************
*** 560,562 ****
  		(void) getnextart(TRUE);
! 		if (bit != i || strcmp(groupdir, ptr3) != 0) {
  			(void) fprintf(ofp, "Can't read %s/%ld.\n", ptr3, i);
--- 555,557 ----
  		(void) getnextart(TRUE);
! 		if (bit != i || STRCMP(groupdir, ptr3) != 0) {
  			(void) fprintf(ofp, "Can't read %s/%ld.\n", ptr3, i);
***************
*** 569,571 ****
  	case 'f':
! 		if (strcmp(h->followto, "poster") == 0) {
  			(void) reply_command();
--- 564,566 ----
  	case 'f':
! 		if (STRCMP(h->followto, "poster") == 0) {
  			(void) reply_command();
***************
*** 585,587 ****
  		if (rfq || *bptr == '-') {
! 			if (strcmp(groupdir, ogroupdir)) {
  				i = bit;
--- 580,582 ----
  		if (rfq || *bptr == '-') {
! 			if (STRCMP(groupdir, ogroupdir)) {
  				i = bit;
***************
*** 658,660 ****
  		*ptr1 = 0;
! 	notauthor = strcmp(username, rcbuf);
  	if (uid != ROOTID && uid && notauthor) {
--- 653,655 ----
  		*ptr1 = 0;
! 	notauthor = STRCMP(username, rcbuf);
  	if (uid != ROOTID && uid && notauthor) {
***************
*** 751,753 ****
  		(void) strcpy(subj, bptr);
! 	if (!prefix(subj, "Re:")){
  		(void) strcpy(bfr, subj);
--- 746,748 ----
  		(void) strcpy(subj, bptr);
! 	if (!PREFIX(subj, "Re:")){
  		(void) strcpy(bfr, subj);
***************
*** 840,842 ****
  	}
! 	if (s_find(&srec, bptr) == NULL) {
  		fprintf(ofp, "%s not in SYSFILE\n", bptr);
--- 835,837 ----
  	}
! 	if (s_find(&srec, bptr) == 0) {
  		fprintf(ofp, "%s not in SYSFILE\n", bptr);
Index: visual.c
Prereq: 1.36
*** .d/visual.c	Wed Oct  7 16:55:47 1987
--- visual.c	Wed Oct  7 18:49:26 1987
***************
*** 6,8 ****
  #ifdef SCCSID
! static char	*SccsId = "@(#)visual.c	1.36	3/21/87";
  #endif /* SCCSID */
--- 6,8 ----
  #ifdef SCCSID
! static char	*SccsId = "@(#)visual.c	1.37	10/7/87";
  #endif /* SCCSID */
***************
*** 19,25 ****
  #include <errno.h>
- #if defined(BSD4_2) || defined(BSD4_1C)
- #include <sys/dir.h>
- #else
- #include "ndir.h"
- #endif
  #ifdef BSD4_2
--- 19,20 ----
***************
*** 29,30 ****
--- 24,26 ----
  #endif /* BSD4_2 */
+ 
  #ifdef MYDB
***************
*** 78,80 ****
  extern int _junked;
! #define clearok(xxx, flag) _junked = flag
  extern int COLS;
--- 74,76 ----
  extern int _junked;
! #define okclear() (_junked = 1)
  extern int COLS;
***************
*** 356,358 ****
  		ttycooked();
! 		list_group(groupdir, countset ? count : 0,
  			(c == 'l') ? FALSE : TRUE, pngsize);
--- 352,354 ----
  		ttycooked();
! 		list_group(groupdir, countset ? (int) count : 0,
  			(c == 'l') ? FALSE : TRUE, pngsize);
***************
*** 359,361 ****
  		ttyraw();
! 		clearok(curscr, 1);
  		updscr();
--- 355,357 ----
  		ttyraw();
! 		okclear();
  		updscr();
***************
*** 386,388 ****
  					appfile(fp, lastlin + 1);
! 			} while(strncmp(linebuf, "------------------------", 24)
  				!= 0);
--- 382,384 ----
  					appfile(fp, lastlin + 1);
! 			} while(STRNCMP(linebuf, "------------------------", 24)
  				!= 0);
***************
*** 636,638 ****
  		obit = bit;
! 		if (strcmp(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
--- 632,634 ----
  		obit = bit;
! 		if (STRCMP(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
***************
*** 854,856 ****
  		if (!ptr2) {
! 			if (strcmp(ptr3, "cancelled") == 0)
  				msg("%s has been cancelled", linebuf);
--- 850,852 ----
  		if (!ptr2) {
! 			if (STRCMP(ptr3, "cancelled") == 0)
  				msg("%s has been cancelled", linebuf);
***************
*** 874,876 ****
  		(void) strcpy(ogroupdir, ptr3);
! 		if (strcmp(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
--- 870,872 ----
  		(void) strcpy(ogroupdir, ptr3);
! 		if (STRCMP(groupdir, ogroupdir)) {
  			(void) strcpy(bfr, groupdir);
***************
*** 886,888 ****
  		getnextart(TRUE);
! 		if (bit != nart || strcmp(groupdir, ptr3) != 0) {
  			msg("can't read %s/%ld", ptr3, nart);
--- 882,884 ----
  		getnextart(TRUE);
! 		if (bit != nart || STRCMP(groupdir, ptr3) != 0) {
  			msg("can't read %s/%ld", ptr3, nart);
***************
*** 895,897 ****
  	case 'f':
! 		if (strcmp(h->followto, "poster") == 0) {
  			reply(FALSE);
--- 891,893 ----
  	case 'f':
! 		if (STRCMP(h->followto, "poster") == 0) {
  			reply(FALSE);
***************
*** 949,951 ****
  
! 	poster = senderof(&h);
  	/* only compare up to '.' or ' ' */
--- 945,947 ----
  
! 	poster = senderof(h);
  	/* only compare up to '.' or ' ' */
***************
*** 957,959 ****
  	tfilename = filename;
! 	notauthor = strcmp(username, poster);
  	if (uid != ROOTID && uid && notauthor) {
--- 953,955 ----
  	tfilename = filename;
! 	notauthor = STRCMP(username, poster);
  	if (uid != ROOTID && uid && notauthor) {
***************
*** 1006,1008 ****
  	(void) strcpy(subj, h->title);
! 	if (!prefix(subj, "Re:")){
  		(void) strcpy(bfr, subj);
--- 1002,1004 ----
  	(void) strcpy(subj, h->title);
! 	if (!PREFIX(subj, "Re:")){
  		(void) strcpy(bfr, subj);
***************
*** 1283,1285 ****
  						*p++ = '\0';
! 					if (strcmp(ibuf, groupdir) == 0) {
  						register char *q;
--- 1279,1281 ----
  						*p++ = '\0';
! 					if (STRCMP(ibuf, groupdir) == 0) {
  						register char *q;
***************
*** 1469,1471 ****
  	}
! 	else if (strcmp(hp->nbuf, groupdir) != 0) {
  		(void) sprintf(linebuf, "Newsgroups: %s", hp->nbuf);
--- 1465,1467 ----
  	}
! 	else if (STRCMP(hp->nbuf, groupdir) != 0) {
  		(void) sprintf(linebuf, "Newsgroups: %s", hp->nbuf);
***************
*** 1588,1590 ****
  	*maxcol = '\0';
! 	if (strncmp(linebuf, ">From ", 6) == 0) {
  		register char *p;
--- 1584,1586 ----
  	*maxcol = '\0';
! 	if (STRNCMP(linebuf, ">From ", 6) == 0) {
  		register char *p;
***************
*** 1758,1760 ****
  		ttyraw();
! 		clearok(curscr, 1);
  #ifdef SIGTSTP
--- 1754,1756 ----
  		ttyraw();
! 		okclear();
  #ifdef SIGTSTP
***************
*** 1785,1787 ****
  			;
! 		n = (int)p - (int)linebuf;
  		if ( (n > 23 && n < 33) || (n > 65 && n < 79)) {
--- 1781,1783 ----
  			;
! 		n = (int) (p - linebuf);
  		if ( (n > 23 && n < 33) || (n > 65 && n < 79)) {
***************
*** 1909,1911 ****
  		strcpy(prompt,"more? ");
! 		clearok(curscr, 1);
  		updscr();
--- 1905,1907 ----
  		strcpy(prompt,"more? ");
! 		okclear();
  		updscr();
***************
*** 2166,2168 ****
  	if (c == '\f') {
! 		clearok(curscr, 1);
  		prflags &=~ NOPRT;
--- 2162,2164 ----
  	if (c == '\f') {
! 		okclear();
  		prflags &=~ NOPRT;
***************
*** 2524,2526 ****
  #else 	/* !TIOCGWINSZ */
! 	clearok(curscr, 1);
  	updscr();
--- 2520,2522 ----
  #else 	/* !TIOCGWINSZ */
! 	okclear();
  	updscr();
***************
*** 2628,2630 ****
  	if (err) {
! 		clearok(curscr, 1);
  		updscr();
--- 2624,2626 ----
  	if (err) {
! 		okclear();
  		updscr();
***************
*** 2646,2648 ****
  #ifdef SORTACTIVE
! 	if (strncmp(ACTIVE,"/tmp/", 5) == 0)
  		(void) unlink(ACTIVE);
--- 2642,2644 ----
  #ifdef SORTACTIVE
! 	if (STRNCMP(ACTIVE,"/tmp/", 5) == 0)
  		(void) unlink(ACTIVE);
Index: patchlevel.h
Prereq: 9
*** .d/patchlevel.h	Wed Oct  7 16:53:43 1987
--- patchlevel.h	Wed Oct  7 18:49:18 1987
***************
*** 1,3 ****
! #define	PATCHLEVEL	9
  
! #define NEWS_VERSION   "B 2.11 9/24/87"
--- 1,3 ----
! #define	PATCHLEVEL	10
  
! #define NEWS_VERSION   "B 2.11 10/07/87"

pierre@imag.UUCP (Pierre LAFORGUE) (10/12/87)

In article <44104@beno.seismo.CSS.GOV> rick@seismo.CSS.GOV (Rick Adams) writes:
%Description:
%	This is patch #10 for news 2.11 src.
%	....
%	Sendbatch fixed to work when 'test' is a builtin.
%	....
%! : '@(#)sendbatch.sh	1.11	9/24/87'
%	....
%! 	while test $? -eq 0 -a \( \( -n "$testit" -s BATCHDIR/$rmt \) -o -s BATCHDIR/$rmt.work -o  \( -n "$DOIHAVE" -a -s BATCHDIR/$rmt.ihave \) \)

This is cleaner, but it miss a "-a", at least on Vax/BSD4.3 ; it should be :
 	while test $? -eq 0 -a \( \( -n "$testit" -a -s BATCHDIR/$rmt \) -o -s BATCHDIR/$rmt.work -o  \( -n "$DOIHAVE" -a -s BATCHDIR/$rmt.ihave \) \)

-- 
Pierre Laforgue                pierre@imag.imag.fr             76.51.46.30