[net.news.b] Help! Wierdness in Readnews!

borman (06/25/82)

We are running 2.8 news, and recently some real weirdness was found.
Here's the scoop:
	A user was reading news.  Suddenly, halfway through, he hits a
return to read the next article, and gets
	sh: My: not found
Now, it happens that this is an article long enough to invoke the pager.
We have written our own pager which is compiled into news.  The string
for PAGER is set to "My Own" at the start of readnews, and is only changed
if the user has defined PAGER in his environment.  Well, anyhow, I got
a core dump, and went in poking around.  When I looked at the PAGER
string, it had changed to
	My@j@`wn
that is, the " O" got changed to a CTRL/J and a NULL.  Thus, when
a strcmp was done with *PAGER and "My Own", it failed, and so it
tried to popen "My\n".  So, I understand why he got the shell message,
but what I don't understand is how the heck the the string got
changed in the first place!

The fact that a "\n\0" was put on after the first word in the string
makes me think that this wasn't a lost bit or something bizzare like
that, but I can't figure out how it would have happened.  I feel
reasonably sure that it's not our pager, we've been running it for
several months without any problems. Is there a routine somewhere
that takes a string, finds the first whitespace, and changes it
to a "\n\0"???  I did a massive grep for "\n", and didn't turn up
anything interesting. (of course, with all the fprintf()'s flying
by, I could have missed something...)

Another thing:  The other day someone else was reading news, and
when he type a '-', it gave him back the same article.  I thought
I had fixed that with the fix I posted before, in header.c. (In
fact, I had gone and read news before and after I installed that
fix, and I was able to backup where I wasn't able to before, so
his problem with not being able to back up came from someplace
else)

Of course, I could not duplicate either of these glitches.  Has
anyone out there run into this? or have any ideas on what or
where readnews could be goofing?  I've run out of ideas.

				-Dave Borman
				St. Olaf College
				ihnss!ihsp3!stolaf!borman
				harpo!stolaf!borman