Subject: buglet in and fix for pico/display.c

From: Shane Castle <[email-masked]>
Date: Thu, 15 Oct 1998 08:33:06 -0600 (MDT)

Problem:

If the user's screen is odd-sized, such as 90 cols wide, the display
initially shown by pico is displayed improperly.  An implicit assumption
was made in the code about the screen size that causes it to display
the options across the bottom correctly only if the width is not evenly
divisible by 6.  If it is then an extra character occurs at the bottom
right that screws up the subsequent painting of the characters at the top.

Solution:

Subtract one from the screen width before dividing by six; that way the
extra character, if generated, will never be a problem.

Patch:

--- display.c.dist	Fri Jun 19 11:19:53 1998
+++ display.c	Wed Oct 14 12:59:36 1998
@@ -2350,7 +2350,7 @@
       else
 	nspace[index] = (index < 4) ? 3 : 4;
 
-    tspace = term.t_ncol/6;		/* total space for each item */
+    tspace = (term.t_ncol-1)/6;		/* total space for each item */
     index  = 0;
     for(row = 0; row <= 1; row++){
 	linebuf[0] = '\0';

A final note:

This buglet has been in every version of Pine I have ever seen.
I've tried to get this fix in the code before but never succeeded.
Maybe this time someone will put it in?

Shane Castle             | "Perfection, then, is finally achieved, not
Boulder County Info Svcs | when there is nothing left to add, but when
Boulder CO USA           | there is nothing left to take away."
                         |                - Antoine de Saint-Exupery

-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------