NetBSD-Bugs archive

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

lib/55496: [libcurses] bkgrnd() doesn't works as expected



>Number:         55496
>Category:       lib
>Synopsis:       [libcurses] bkgrnd() doesn't works as expected
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 18 20:05:00 +0000 2020
>Originator:     Naman Jain
>Release:        NetBSD 9.0
>Organization:
IIT Kanpur
>Environment:
NetBSD localhost 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
bkgrnd() does not work as expected.

Expected:
bkgrnd(wch) followed by refresh() should update the rendition for all the characters.

Observed:
It does not update the screen, instead just updates the value of background character.

See bkgd() for more details, which is expected to behave similarly. bkgd() works correctly.
>How-To-Repeat:
A simple program like:

#include <curses.h>
#include <wchar.h>

int main() {
    initscr();

    cchar_t ch;
    wchar_t wstr[] = {0x61, L'\0'};
    setcchar(&ch, wstr, 0x100, 0, NULL);
    //bkgd(0x61);
    bkgrnd(&ch);
    refresh();

    getch();
    endwin();
    return 0;
}
>Fix:
wbkgrnd() needs to update window similar(though not exactly) to what is done in wbkgd() https://github.com/NetBSD/src/blob/599004e121bc2a54553b4fd7eb35303ba09956b1/lib/libcurses/background.c#L102



Home | Main Index | Thread Index | Old Index