NetBSD Problem Report #55496

From www@netbsd.org  Sat Jul 18 20:04:44 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D6EC61A9241
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Jul 2020 20:04:43 +0000 (UTC)
Message-Id: <20200718200442.D9B9E1A9242@mollari.NetBSD.org>
Date: Sat, 18 Jul 2020 20:04:43 +0000 (UTC)
From: jnaman806@gmail.com
Reply-To: jnaman806@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [libcurses] bkgrnd() doesn't works as expected
X-Send-Pr-Version: www-1.0

>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:/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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.