[net.news.b] postnews

mouse@mcgill-vision.UUCP (der Mouse) (08/14/86)

There is a bug in 2.10.3 postnews that causes (some) moderated group
postings to be sent to inews directly, which results in their rejection
due to "unapproved moderated newsgroup".  This will occur when the
group's line in $LIB/moderators contains only spaces (no tabs) between
the newsgroup name and the moderator's address.  The problem is that
<ctype.h> rules that a space is a punctuation character.  In the
routine twosplit(), in postnews.c (old code commented in for loop):

	/*
	 * Split a line of the form
	 *		text whitespace text
	 * into two strings.	Also trim off any trailing newline.
	 * This is destructive on src.
	 */
	twosplit(src, dest1, dest2)
	char *src, *dest1, *dest2;
	{
[three lines deleted]
		for (p=src; !isspace(*p)/*isalnum(*p) || ispunct(*p)*/; p++)
			;
[five more lines deleted]
	}

This even makes the comment accurate!
-- 
					der Mouse

USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!mcgill-vision!mouse
     think!mosart!mcgill-vision!mouse
Europe: mcvax!decvax!utcsri!mcgill-vision!mouse
ARPAnet: utcsri!mcgill-vision!mouse@uw-beaver.arpa

"Come with me a few minutes, mortal, and we shall talk."
			- Thanatos (Piers Anthony's Bearing an Hourglass)

ado@elsie.UUCP (Arthur David Olson) (08/22/86)

> 		for (p=src; !isspace(*p)/*isalnum(*p) || ispunct(*p)*/; p++)
>			;

Since isspace('\0') is false (at least on our 4.1BSD system), our department
of defensive programming recommends that the above test take the form

> 		for (p=src; *p != '\0' && !isspace(*p); p++)
>			;
--
Bug/s is a Volkswagen/Warner Brothers trademark.
--
	UUCP: ..decvax!seismo!elsie!ado   ARPA: elsie!ado@seismo.ARPA
	DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.