Re: lib/59067: wctrans got error member.

"RVP via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
The following reply was made to PR lib/59067; it has been noted by GNATS.

From: RVP <[email protected]>
To: [email protected]
Cc: 
Subject: Re: lib/59067: wctrans got error member.
Date: Wed, 8 Jul 2026 22:48:54 +0000 (UTC)

 On Wed, 26 Feb 2025, RVP via gnats wrote:
 
 > > >Fix:
 > > https://github.com/NetBSD/src/blob/trunk/lib/libc/locale/iswctype_mb.c
 > >
 > > line 132 update to:
 > >
 > > return (wctrans_t)__UNCONST(&rl->rl_wctype[i]);
 > >
 > >   =====>
 > >
 > > return (wctrans_t)__UNCONST(&rl->rl_wctrans[i]);
 > >
 >
 > Yah, I think this is correct, but, there's one additional fix needed for this
 > to work in the "C"/"POSIX" locale too. So, we now have:
 >
 >
 > ---START patch---
 > diff -urN a/src/lib/libc/locale/iswctype_mb.c b/src/lib/libc/locale/iswctype_mb.c
 > --- a/src/lib/libc/locale/iswctype_mb.c	2024-06-07 22:20:47.236031995 +0000
 > +++ b/src/lib/libc/locale/iswctype_mb.c	2025-02-12 11:38:55.548531035 +0000
 > @@ -129,7 +129,7 @@
 >   	for (i = 0; i < _WCTRANS_NINDEXES; ++i) {
 >   		_DIAGASSERT(rl->rl_wctrans[i].te_name != NULL);
 >   		if (!strcmp(rl->rl_wctrans[i].te_name, charmap))
 > -			return (wctrans_t)__UNCONST(&rl->rl_wctype[i]);
 > +			return (wctrans_t)__UNCONST(&rl->rl_wctrans[i]);
 >   	}
 >   	return (wctrans_t)NULL;
 >   }
 > diff -urN a/src/lib/libc/locale/runetable.c b/src/lib/libc/locale/runetable.c
 > --- a/src/lib/libc/locale/runetable.c	2013-08-18 20:03:48.000000000 +0000
 > +++ b/src/lib/libc/locale/runetable.c	2025-02-12 11:45:11.254300802 +0000
 > @@ -320,11 +320,11 @@
 >       "646",
 >       &_citrus_ctype_default,
 >       {
 > -	{   "towlower",
 > +	{   "tolower",
 >   	    __UNCONST(&_DefaultRuneLocale.rl_maplower[0]),
 >   	    __UNCONST(&_DefaultRuneLocale.rl_maplower_ext)
 >   	},
 > -	{   "towupper",
 > +	{   "toupper",
 >   	    __UNCONST(&_DefaultRuneLocale.rl_mapupper[0]),
 >   	    __UNCONST(&_DefaultRuneLocale.rl_mapupper_ext)
 >   	},
 > ---END patch---
 >
 > Should be pulled up to -9, and -10.
 >
 
 This is an easy fix. Bump!
 
 -RVP
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.