'refer' sort problem and fix

cons at sdccsu3.UUCP cons at sdccsu3.UUCP
Sat Aug 4 00:52:17 AEST 1984


Subject: REFER mis-sorts reference lists if duplicate citations occur.
Index:	usr.bin/refer/refer2.c 4.2BSD
      	usr.bin/refer/refer5.c 4.2BSD

Description:
	The putsig routine in refer5.c is responsible for placing
	signals (usually superscripts, or author-date labels) in the
	body of a document.  Putsig also makes the signals available
	for printing in the reference list by emitting strings such as
	".ds [F signal" into the reference list.

	If a reference is cited more than once, it is only put on the
	reference list the first time it is cited.  However putsig
	persists in emitting the ".ds [F ..." string for duplicate
	citations.

	This causes a problem if the reference list is sorted because
	the extraneous ".ds [F ..." material appears at the beginning
	of the next non-duplicate reference where it obscures the
	sortkey.  Thus the reference list is mis-sorted.

Repeat-By:
	Create a document which cites a reference twice, then cites a
	new reference.  Process the document using REFER with the -s
	option.  Notice the extra ".ds [F ..." line in the REFER
	output.  If the two references came out sorted properly, you
	were lucky, reverse their roles and you will see the failure.

Fix:
	Instead of providing the fixes in the form of diff output, the
	sources for refer2.c and refer5.c have been posted to
	net.sources.  Numerous comments and a feature to condense
	numeric signals (1,2,3 becomes 1-3) have been added. You may
	find these useful.

	Brief description of the fix:
	putsig is called at two places in refer2.c, in one context a
	duplicate citation is being processed and in the other a new
	citation is being processed.  Add a flag parameter to putsig to
	distinguish the two calls.  Modify the routine to suppress the
	emission of ".ds [F ..." when it is called for a
	duplicate citation.  (See sources posted to net.sources)

Rick Accurso
UUCP:  ...!ucbvax!sdcsvax!sdccsu3!accurso
ARPA:  sdcsvax!sdccsu3!accurso at nosc



More information about the Comp.bugs.4bsd.ucb-fixes mailing list