NetBSD Problem Report #51673

From www@NetBSD.org  Tue Nov 29 13:38:56 2016
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 78CEA7A324
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 29 Nov 2016 13:38:56 +0000 (UTC)
Message-Id: <20161129133855.8D19A7A32A@mollari.NetBSD.org>
Date: Tue, 29 Nov 2016 13:38:55 +0000 (UTC)
From: carsten.kunze@arcor.de
Reply-To: carsten.kunze@arcor.de
To: gnats-bugs@NetBSD.org
Subject: curses: standend() does not turn off A_BOLD
X-Send-Pr-Version: www-1.0

>Number:         51673
>Category:       lib
>Synopsis:       curses: standend() does not turn off A_BOLD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 29 13:40:00 +0000 2016
>Closed-Date:    Tue Nov 29 22:30:39 +0000 2016
>Last-Modified:  Tue Nov 29 22:30:39 +0000 2016
>Originator:     Carsten Kunze
>Release:        NetBSD 7.99.42 (GENERIC.201611250700Z) amd64
>Organization:
>Environment:
NetBSD 7.99.42 (GENERIC.201611250700Z) amd64
>Description:
As of http://pubs.opengroup.org/onlinepubs/7908799/xcurses/standend.html standend() should turn off all attribute. A test shows that A_BOLD stays active.
>How-To-Repeat:
The following source compiled with

cc main.c -lcurses

should draw "bold" in bold and "normal" without attributes. But both are displayed in bold. If

attroff(A_BOLD);

or

attrset(A_NORMAL);

is used instead of standend() it works.

#include <curses.h>

int
main()
{
        initscr();
        attron(A_BOLD);
        addstr("bold");
        standend();
        addstr(" normal");
        refresh();
        getch();
        endwin();
        return 0;
}

>Fix:

>Release-Note:

>Audit-Trail:
From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: lib/51673: curses: standend() does not turn off A_BOLD
Date: Tue, 29 Nov 2016 12:11:29 -0500

 On Nov 29,  1:40pm, carsten.kunze@arcor.de (carsten.kunze@arcor.de) wrote:
 -- Subject: lib/51673: curses: standend() does not turn off A_BOLD

 This is a difference between XPG4 curses and BSD curses. I am not sure what's
 the best way to deal with it.

 http://pubs.opengroup.org/onlinepubs/9693989999/toc.pdf says that standend()
 is equivalent to calling attron(A_NORMAL), whereby our man pages state that
 standend only turns off the standout attribute.

 I think that we should follow suit, but it feels wrong :-)

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51673 CVS commit: src/lib/libcurses
Date: Tue, 29 Nov 2016 12:33:48 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Tue Nov 29 17:33:48 UTC 2016

 Modified Files:
 	src/lib/libcurses: curses_standout.3 standout.c

 Log Message:
 PR/51673: Carsten Kunze: curses: standend() does not turn off A_BOLD;
 according the X/Open it needs to turn off all attributes.


 To generate a diff of this commit:
 cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/curses_standout.3
 cvs rdiff -u -r1.16 -r1.17 src/lib/libcurses/standout.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Carsten Kunze <carsten.kunze@arcor.de>
To: christos@zoulas.com, gnats-bugs@netbsd.org, lib-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: lib/51673: curses: standend() does not turn off A_BOLD
Date: Tue, 29 Nov 2016 19:15:09 +0100 (CET)

 christos@zoulas.com (Christos Zoulas) wrote:

 > This is a difference between XPG4 curses and BSD curses. I am not sure
 > what's
 > the best way to deal with it.
 > 
 > http://pubs.opengroup.org/onlinepubs/9693989999/toc.pdf says that
 > standend()
 > is equivalent to calling attron(A_NORMAL), whereby our man pages state that
 > standend only turns off the standout attribute.
 > 
 > I think that we should follow suit, but it feels wrong :-)

 Sorry, I didn't know, that it is intended.  Brett Lymn wrote few days ago, that NetBSD curses follows the spec mentioned above.  Because of that I even didn't check the manpage--which clearly states that only A_STANDOUD is cleared.  It does not harm to add a attrset(A_NORMAL) in the code which works with ncurses too.  Maybe it is better to withdraw this commit.  Sorry for the work and confusion :(

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, lib-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, carsten.kunze@arcor.de
Cc: 
Subject: Re: lib/51673: curses: standend() does not turn off A_BOLD
Date: Tue, 29 Nov 2016 13:58:35 -0500

 On Nov 29,  6:20pm, carsten.kunze@arcor.de (Carsten Kunze) wrote:
 -- Subject: Re: lib/51673: curses: standend() does not turn off A_BOLD

 |  Sorry, I didn't know, that it is intended.  Brett Lymn wrote
 | few days ago, that NetBSD curses follows the spec mentioned above.
 | Because of that I even didn't check the manpage--which clearly
 | states that only A_STANDOUD is cleared.  It does not harm to add
 | a attrset(A_NORMAL) in the code which works with ncurses too.
 | Maybe it is better to withdraw this commit.  Sorry for the work
 | and confusion :(

 Given that the man page for curses says we follow the X/Open Spec, I've
 changed it per the spec.

 christos

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 29 Nov 2016 22:30:39 +0000
State-Changed-Why:
fixed
(well, "fixed", I kind of agree that it feels wrong, but this one
doesn't seem worth fighting over)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.