[comp.windows.x] xman bug and fix

eli@haddock.ima.isc.com (Elias Israel) (11/04/88)

VERSION:
	R3 (and before)

CLIENT MACHINE and OPERATING SYSTEM:
	Apollo DN3000 running SR10

DISPLAY:
	19" 1 plane

WINDOW MANAGER:
	none

AREA:
	xman

SYNOPSIS:
	xman faults on man pages smaller than a screenful
	(this problem should occur on all systems).

DESCRIPTION:
	xman faults on small pages because it calculates the number of
	lines to print by subtracting the line-size of the screen from
	the line-size of the file, and uses that as a length.  In this
	case, make sure the number of lines to print is non-negative.

REPEAT BY:
	choose a small man page like clear(1) with the left button.
	it should bomb.

SAMPLE FIX:
*** ScrollByL.c.orig	Thu Nov  3 17:29:46 1988
--- ScrollByL.c	Thu Nov  3 17:33:07 1988
***************
*** 613,618 ****
--- 613,621 ----
      max_lines = sblw->scroll_by_line.lines -
       child->core.height / sblw->scroll_by_line.font_height;
  
+     if ( max_lines < 0)
+       max_lines = 0;
+ 
      if ( new_line > max_lines ) {
        new_line = max_lines;
        move_thumb = TRUE;