bug-ncurses
[Top][All Lists]
Advanced

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

mvhline has some problem. Please have a look.


From: address@hidden
Subject: mvhline has some problem. Please have a look.
Date: Mon, 6 Apr 2020 03:19:20 +0000

HI all,

I am working with

Linux version 4.15.0-91-generic (buildd@lgw01-amd64-013) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020

And ncurses  version  6.2  (patch 20200328)

 

The program looks like this:

initscr();

start_color();

cbreak();

keypad(stdscr, TRUE);

noecho();

init_pair(1, COLOR_CYAN, COLOR_BLACK);

attron(COLOR_PAIR(1));

mvhline(10,     0, '-', 20);

refresh();

       … …

And Output looks like this:

-

It should look like this:

--------------------

 

The problem may be here:

ncurses/tty/tty_update.c

 

622         } else if (repeat_char != 0 &&

623 #if USE_WIDEC_SUPPORT

624                (!SP_PARM->_screen_unicode &&

625             (CharOf(ntext0) < ((AttrOf(ntext0) & A_ALTCHARSET)

626                        ? ACS_LEN

627                        : 256))) &&

628 #endif

629                runcount > SP_PARM->_rep_cost) {       // begin of else if

630         NCURSES_CH_T temp;

631         bool wrap_possible = (SP_PARM->_curscol + runcount >=

632                       screen_columns(SP_PARM));

633         int rep_count = runcount;

634

635         if (wrap_possible)

636             rep_count--;

637

638         UpdateAttrs(SP_PARM, ntext0);

639         temp = ntext0;

640         if ((AttrOf(temp) & A_ALTCHARSET) &&

641             SP_PARM->_acs_map != 0 &&

642             (SP_PARM->_acs_map[CharOf(temp)] & A_CHARTEXT) != 0) {

643             SetChar(temp,

644                 (SP_PARM->_acs_map[CharOf(ntext0)] & A_CHARTEXT),

645                 AttrOf(ntext0) | A_ALTCHARSET);

646         }

647         NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx

648                     TPARM_2(repeat_char,

649                         CharOf(temp),

650                         rep_count),

651                     1,

652                     NCURSES_SP_NAME(_nc_outch));

653         SP_PARM->_curscol += rep_count;

654

655         if (wrap_possible)

656             PutChar(NCURSES_SP_ARGx CHREF(ntext0));

657         } else {

658         for (i = 0; i < runcount; i++)

659             PutChar(NCURSES_SP_ARGx CHREF(ntext[i]));

660         }

 

Line 657 ‘s “}” is paired with Line 629.

So if wrap_possible is false, the program will not run in to Line 657’s else branch.


reply via email to

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