[net.news.b] Bugfix for "vnews"

guido@mcvax.UUCP (B Guru) (03/30/84)

Here is a small bugfix for Kenneth Almquist's "vnews" (posted to net.sources
every now and then) which caused me to miss many articles.  This is
especially important for sites that don't receive all news (are there any
that do?).

The symptom: Articles aren't shown if the first newsgroup mentioned
isn't received by us.
[Note: I subscribe to "all"; when I don't like the load of news
in a specific newsgroup, I eventually unsubscribe through the
"ug" (readnews: U) command.]

The bug: vnews wants to show an article only if the current newsgroup is the
first newsgroup subscribed to on the Newsgroups: line.  When the
newsgroups matches the general list ("all" in my case), it assumes only
groups with an explicit ! in their .newsrc line are not in the subscription
list.  However, of course, groups that aren't received have no .newsrc
line either, and are NOT (in any useful sense, at least) in the subscription
list.

The fix: in rightgroup(), the last function in "visual.c", change the test
so that only groups with a .newsrc line AND no ! are considered as
subscriptions, rather than groups with no .newsrc line OR no !.

*** visual.c	Sat Mar 17 22:24:52 1984
--- .../src/visual.c	Wed Feb 29 13:41:48 1984
***************
*** 2190,2196
      		return flag;
      	}
      	if (ngmatch(g, header.nbuf)
!     	 && (i = findrcline(g)) >= 0 && index(rcline[i], '!') == NULL) {
      		flag = 0;
      	}
      	g = p;

--- 2190,2196 -----
      		return flag;
      	}
      	if (ngmatch(g, header.nbuf)
!     	 && ((i = findrcline(g)) < 0 || index(rcline[i], '!') == NULL)) {
      		flag = 0;
      	}
      	g = p;

--
Guido van Rossum, CWI, Amsterdam     guido@mcvax

(I suddenly realize that now I have to wade through
even MORE junk in net.micro and net.unix-wizards!)