[news.software.b] Cnews histdups broken after patch

gerry@jts.com (G. Roderick Singleton ) (06/10/91)

Somewhere along the line, a patch ( no way to tell which one ) added
three lines too many.

Since I've run into the problem, I suspect others may also have
inherited this little problem.  What follows are two version of the
histdups awk script.  The faulty one first then the working one.  If
any one recognizes the patch that produces this result, I'd sure like
to know as it may have introduced other problems.

Here's the faulty histdups ( note the extra print line at the end ):

# Awk program to merge history lines for the same article in a sorted history
# file (such as is generated during the mkhistory processing).
BEGIN { FS = "\t" ; OFS = "\t" ; mesgid = "" }
{
	if ($1 != mesgid) {
		if (mesgid != "")
			print mesgid, dates, names
		mesgid = $1
		dates = $2
		names = $3
	} else
		names = names " " $3
}
END {
	if (mesgid != "")
		print mesgid, dates, names
}
	print mesgid, dates, names
}


Now my known working version (pre-patch):

# Awk program to merge history lines for the same article in a sorted history
# file (such as is generated during the mkhistory processing).
BEGIN { FS = "\t" ; OFS = "\t" ; mesgid = "" }
{
	if ($1 != mesgid) {
		if (mesgid != "")
			print mesgid, dates, names
		mesgid = $1
		dates = $2
		names = $3
	} else
		names = names " " $3
}
END { if (mesgid != "")
	print mesgid, dates, names
}


If memory serves me right,  there was a patch that addressed duplicates
some time ago.  It was not official (i.e. from geoff or henry).  I can't
find any such patch in my cnews source tree but I wonder.

ger
-- 
G. Roderick Singleton, System and Network Manager, JTS Computers 
{yunexus | uunet | geac | torsqnt}!gerry@jtsv16.jts.com

henry@zoo.toronto.edu (Henry Spencer) (06/10/91)

In article <1991Jun9.181012.25570@jts.com> gerry@jts.com (G. Roderick Singleton ) writes:
>Somewhere along the line, a patch ( no way to tell which one ) added
>three lines too many.

I think you need to look for either a bug in your version of patch or a
garbled copy of the 16-Mar-1991 patch.  Neither the distribution copies nor
the patch as distributed contain this problem.
-- 
"We're thinking about upgrading from    | Henry Spencer @ U of Toronto Zoology
SunOS 4.1.1 to SunOS 3.5."              |  henry@zoo.toronto.edu  utzoo!henry