Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

postnews() bug (2.10.3), with fix

0 views
Skip to first unread message

der Mouse

unread,
Aug 13, 1986, 11:56:13 PM8/13/86
to
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!mo...@uw-beaver.arpa

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

Arthur David Olson

unread,
Aug 22, 1986, 11:37:04 AM8/22/86
to
> 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!a...@seismo.ARPA
DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.

0 new messages