ul doesn't overstrike correctly

Richard Doty rdoty at daemon.UUCP
Sat Apr 20 15:12:11 AEST 1985


Subject: ul doesn't overstrike properly
Index:	ucb/ul.c 4.2BSD

Description:
	When printing a sequence of overstruck characters (not under-
	lined chars) ul prints the first character in the sequence,
	rather than the last.

	Recognition of this as a bug comes from 2 reasons: first, on
	terminals that don't do real overstriking, common behavior is
	to replace a character with the next one printed in that
	character cell.  Second, the line of code that is changed to
	fix this bug is clearly not kosher.

	The sccsid from my ul.c is: "@(#)ul.c	4.5 (Berkeley) 8/11/83";

Repeat-By:
	Create a file that has `A^HB^HC' in it, and run it through
	ul (here, ^H signifies a backspace character).  The buggy
	ul will print 'A'.  The 'correct' behavior is to output 'C'.

Fix:
	Here is a diff showing the change.

*** /usr/src/ucb/ul.c	Thu Aug 11 21:32:31 1983
--- ul.c.new	Thu Apr 18 21:38:13 1985
***************
*** 202,208
  		} else if (obuf[col].c_char == c)
  			obuf[col].c_mode |= BOLD|mode;
  		else {
! 			obuf[col].c_mode = c;
  			obuf[col].c_mode = mode;
  		}
  		col++;

--- 202,212 -----
  		} else if (obuf[col].c_char == c)
  			obuf[col].c_mode |= BOLD|mode;
  		else {
! 			/*
! 			 * when there is a series of overprinting
! 			 * characters, output the *last* one.
! 			 */
! 			obuf[col].c_char = c;
  			obuf[col].c_mode = mode;
  		}
  		col++;


Richard A. Doty				uucp:	 tektronix!rdoty
Small Systems Support Group			 tektronix!usenet
Tektronix, Inc.				CSnet:	 rdoty at tek
Beaverton, OR 97077			ARPAnet: rdoty.tek at csnet-relay
					phone:	 (503) 627-6517



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