bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug report & patch


From: Tony Li
Subject: Bug report & patch
Date: Tue, 29 Jun 2004 13:39:10 -0700


Ncurses version: 5.4
OS: Mac OS X 10.3.4
Compiler: gcc 3.3 (Apple)
Terminal: xterm (XFree86)

Symptom:

When using the menu library, the set_menu_format() command produces different formats
        depending on whether the menu has been posted or not.

Analysis:

        In set_menu_format() we find the code:

   total_cols = (menu->status & O_ROWMAJOR) ?
        minimum(menu->nitems,cols) :
          (menu->nitems-1)/total_rows + 1;

Normally, options are stored in menu->opt, not menu->status, which is used for such bits as _POSTED. This appears to be simply a typo of an incorrect field name.

Patch:

Index: m_format.c
===================================================================
RCS file: /home/eng/.CVS/config/tools/src/ncurses/menu/m_format.c,v
retrieving revision 1.1
diff -c -r1.1 m_format.c
*** m_format.c  23 Jun 2004 05:09:34 -0000      1.1
--- m_format.c  29 Jun 2004 20:35:07 -0000
***************
*** 84,90 ****

        assert(rows>0 && cols>0);
        total_rows = (menu->nitems - 1)/cols + 1;
!       total_cols = (menu->status & O_ROWMAJOR) ?
        minimum(menu->nitems,cols) :
          (menu->nitems-1)/total_rows + 1;

--- 84,90 ----

        assert(rows>0 && cols>0);
        total_rows = (menu->nitems - 1)/cols + 1;
!       total_cols = (menu->opt & O_ROWMAJOR) ?
        minimum(menu->nitems,cols) :
          (menu->nitems-1)/total_rows + 1;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]