[net.news.b] Fixed one Bug, & found 2 more

borman (06/19/82)

We've found another bug in readnews.  If you call readnews with
	readnews -c -h
you get "From: xxxxxx" lines AFTER you are prompted with the ?
and the "From: xxxxxx" refers to the article before, not the article
it's starting to print.  Using either flag by itself seems to work
fine, but here's a fix to readr.c to solve this quirk.  It's from
around line 250 in the vanilla 2.7 sources.
		case 'y':
			if (*bptr != '\0') goto badropt;
		case '\0':
			if (!bptr[-1] && rfq)
				return;
			readmode = NEXT;
			clear(bit);
			saveart;
			nextbit();
#ifdef	FIX
			if (hflag && !cflag) {
#else
			if (hflag) {
#endif	FIX
				fprintf(ofp, "From: %s\n", h.path);
				fflush(ofp);

While searching through to find all the ramifications of this change,
I've discovered a couple of other problems.

	I tried using Berkeley mail to interface:
		readnews -h -c "Mail -f %"
	(we don't have the -T option yet) and it choked, because
	there weren't any From: lines!!!!! (I verified this by
		readnews -h -p
	which will in effect send to the screen what would have
	gone into the temp file)

	So then, I tried
		readnews -c "Mail -f %"
	and Berkeley mail choked on the From line that had my
	real name in it.  For some strange reason it didn't seem
	to think that "(David Borman)" was a valid date string!!
	(a bit of sarcasim in my voice on that last sentence)

	When I tried yea old standard /bin/mail program
		readnews -h -c "/bin/mail -f %"
	it acted the same way as Berkeley did: no From lines, so
	no messages.  Next I tried
		readnews -c "/bin/mail -f %"
	and it worked just fine, 'cause it didn't try to parse
	the From line (Oh, the joys of simple minded programs...)

	Anyhow, I've thougt of a number of ways to fix these problems:

	1)	dissallow the combination of the -c & -h flag
		if you give the -c a string. (Seems like a
		silly solution)
	2)	make the "much less verbose format" of the -h
		option include a From line
	3)	Make Berkeley Mail understand about real names
	4)	If you're using a different interface, strip
		out the real name before writing to the tmp file.
	5)	Put the real name on a seperate line from the
		From line,  e.g:
			From: stolaf!borman Sat Jun 19 2:10:32 1982
			Real Name: David Borman
	6)	Abolish the Real Name.

(Actually, 1&2 address 1 problem, and 3-6 address the other)
Also, note that in the above cases, the pflag gets set, so that the
change I mentioned at the top doesn't even enter in.

Any of you folks run into these problems?  And if so, has any one taken
any action yet?  And if no one has taken any action, before I plunge into
this, which of the above is the way to go? Or are there better solutions
I haven't thought of?  Anyhow, I'll be watching to see what others say first.
(mayby there's a more recent version of Berkeley Mail that can handle this.
If so, let me know how we can get a copy!)

				-Dave Borman
				St. Olaf College
				ihnss!ihps3!stolaf!borman