Bug in me macros, 4.1bsd

Kenneth A Reek kar at ritcv.UUCP
Fri Nov 11 12:14:03 AEST 1983


I have found a bug in the "me" macros that shows up in an unusual way.

	I am working on a rather complicated document that includes sections
and floating figures.  I defined a $0 macro to capture the section names and
add them to an index.  Every once in a while when the index was printed, a few
section names had turned into a newline.  I first thought that it was a problem
in my input file, but the name printed fine in the section heading itself.

	After seeing this a few times, I finally saw the pattern.  Whenever a
section header printed out just after a float ".(z" had printed out, only then
would the section name disappear from the index.  I looked through the macros
and found a string named "|x" used in the section header macros, the index
macros, and the float macros, and nowhere else.  In the section header stuff
it appeared to be a temporary that held the section name.  I guessed that
its use in the float was destroying the section name.  To test the theory
I changed the all of the |x to |y in sh.me and all of the |x to |w in float.me,
as neither |w nor |y were used anywhere else.  Sure enough, this made the
problem go away.  Perhaps a smaller change would have worked, but I prefer to
experiment with nroff macros as little as possible.

	Ken Reek, Rochester Institute of Technology
	seismo!rochester!ritcv!kar



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