From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8535 Path: news.gmane.org!not-for-mail From: Julien Ramseier Newsgroups: gmane.linux.lib.musl.general Subject: localeconv and char values Date: Mon, 21 Sep 2015 12:21:34 +0200 Message-ID: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866" X-Trace: ger.gmane.org 1442830928 12721 80.91.229.3 (21 Sep 2015 10:22:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2015 10:22:08 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8547-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 21 12:22:08 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZdyEX-0004Mi-C4 for gllmg-musl@m.gmane.org; Mon, 21 Sep 2015 12:22:05 +0200 Original-Received: (qmail 12034 invoked by uid 550); 21 Sep 2015 10:22:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11822 invoked from network); 21 Sep 2015 10:21:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version; bh=TKlXZRMR19roRYlDh2vjGXPTtdmfR27KYCPFZnJW5LU=; b=rxLNH3oQct6cLNcwNXMWxdcR39fGKU+H/xni/g0iF8pv4O4daoYdrk0w2RFvPKqZxi sjkRWrDd5zX2M9c6fDdlOpSmZZCZQoQysfX+0WA/1JkHgsyAxlVxkkjXsdPRmSGqHxSU zleSuu2k8pgy1gHCTkbRHZ30vINvhfrU4QSl5kWkEV2zl9s7T3z6TgOiQtYu/9I89BVf jC3/HoF3ZJSGKu9F6A1en2sjZJFCC3DjP+kE9staJ/WreO8Q5Le6YYjRmRzcowSu+fQ1 j2X4tScuxmqdSSehAbxDTde1NtgNZCWakOUJ0Ayazh6oZcQBwcWpdFVMeDMSw37TpS4u 04Fg== X-Received: by 10.180.11.212 with SMTP id s20mr12215319wib.40.1442830896017; Mon, 21 Sep 2015 03:21:36 -0700 (PDT) X-Mailer: Apple Mail (2.2102) Xref: news.gmane.org gmane.linux.lib.musl.general:8535 Archived-At: --Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello, Currently, all the char fields of the lconv struct returned by = localeconv are set to -1. According to = http://pubs.opengroup.org/onlinepubs/9699919799/functions/localeconv.html = , negative values are not valid and CHAR_MAX should be used to indicate = non-available values. If I=E2=80=99m not missing anything, here=E2=80=99s the corresponding = patch: =E2=80=94 Julien --Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866 Content-Type: multipart/mixed; boundary="Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B" --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hello,

Currently, all the char fields of the lconv struct returned = by localeconv are set to -1.

negative values are not valid and = CHAR_MAX should be used to indicate non-available values.

If I=E2=80=99m not = missing anything, here=E2=80=99s the corresponding patch:
= --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B Content-Disposition: attachment; filename=fix-localeconv-char.diff Content-Type: application/octet-stream; name="fix-localeconv-char.diff" Content-Transfer-Encoding: 7bit diff --git a/src/locale/localeconv.c b/src/locale/localeconv.c index cbc75d7..4cbb9dc 100644 --- a/src/locale/localeconv.c +++ b/src/locale/localeconv.c @@ -1,4 +1,5 @@ #include +#include static const struct lconv posix_lconv = { .decimal_point = ".", @@ -11,20 +12,20 @@ static const struct lconv posix_lconv = { .mon_grouping = "", .positive_sign = "", .negative_sign = "", - .int_frac_digits = -1, - .frac_digits = -1, - .p_cs_precedes = -1, - .p_sep_by_space = -1, - .n_cs_precedes = -1, - .n_sep_by_space = -1, - .p_sign_posn = -1, - .n_sign_posn = -1, - .int_p_cs_precedes = -1, - .int_p_sep_by_space = -1, - .int_n_cs_precedes = -1, - .int_n_sep_by_space = -1, - .int_p_sign_posn = -1, - .int_n_sign_posn = -1, + .int_frac_digits = CHAR_MAX, + .frac_digits = CHAR_MAX, + .p_cs_precedes = CHAR_MAX, + .p_sep_by_space = CHAR_MAX, + .n_cs_precedes = CHAR_MAX, + .n_sep_by_space = CHAR_MAX, + .p_sign_posn = CHAR_MAX, + .n_sign_posn = CHAR_MAX, + .int_p_cs_precedes = CHAR_MAX, + .int_p_sep_by_space = CHAR_MAX, + .int_n_cs_precedes = CHAR_MAX, + .int_n_sep_by_space = CHAR_MAX, + .int_p_sign_posn = CHAR_MAX, + .int_n_sign_posn = CHAR_MAX, }; struct lconv *localeconv(void) --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

=E2=80=94
Julien
= --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B-- --Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8536 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: localeconv and char values Date: Mon, 21 Sep 2015 10:54:25 -0400 Message-ID: <20150921145425.GQ17773@brightrain.aerifal.cx> References: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1442847295 20679 80.91.229.3 (21 Sep 2015 14:54:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2015 14:54:55 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8548-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 21 16:54:55 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Ze2UQ-0004VS-28 for gllmg-musl@m.gmane.org; Mon, 21 Sep 2015 16:54:46 +0200 Original-Received: (qmail 29757 invoked by uid 550); 21 Sep 2015 14:54:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 29710 invoked from network); 21 Sep 2015 14:54:39 -0000 Content-Disposition: inline In-Reply-To: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8536 Archived-At: On Mon, Sep 21, 2015 at 12:21:34PM +0200, Julien Ramseier wrote: > Hello, > > Currently, all the char fields of the lconv struct returned by > localeconv are set to -1. > > According to > http://pubs.opengroup.org/onlinepubs/9699919799/functions/localeconv.html > , > negative values are not valid and CHAR_MAX should be used to > indicate non-available values. As far as I can tell, you are right. I don't know how I overlooked/misread this, except perhaps that using CHAR_MAX is rather ugly/inappropriate because it assumes CHAR_MAX is not an interesting character that could be used for these purposes. Thankfully that's true for ASCII and ASCII supersets (in our case, UTF-8), so it's not a practical problem. > If I’m not missing anything, here’s the corresponding patch: I'll look it over again before committing, but I don't see anything immediately wrong with it. Thanks! Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8537 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: localeconv and char values Date: Mon, 21 Sep 2015 16:23:33 -0400 Message-ID: <20150921202333.GS17773@brightrain.aerifal.cx> References: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> <20150921145425.GQ17773@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1442867035 29060 80.91.229.3 (21 Sep 2015 20:23:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2015 20:23:55 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8549-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 21 22:23:54 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Ze7cs-00048H-V3 for gllmg-musl@m.gmane.org; Mon, 21 Sep 2015 22:23:51 +0200 Original-Received: (qmail 14219 invoked by uid 550); 21 Sep 2015 20:23:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 14195 invoked from network); 21 Sep 2015 20:23:47 -0000 Content-Disposition: inline In-Reply-To: <20150921145425.GQ17773@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8537 Archived-At: On Mon, Sep 21, 2015 at 10:54:25AM -0400, Rich Felker wrote: > On Mon, Sep 21, 2015 at 12:21:34PM +0200, Julien Ramseier wrote: > > Hello, > > > > Currently, all the char fields of the lconv struct returned by > > localeconv are set to -1. > > > > According to > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/localeconv.html > > , > > negative values are not valid and CHAR_MAX should be used to > > indicate non-available values. > > As far as I can tell, you are right. I don't know how I > overlooked/misread this, except perhaps that using CHAR_MAX is rather > ugly/inappropriate because it assumes CHAR_MAX is not an interesting > character that could be used for these purposes. Thankfully that's > true for ASCII and ASCII supersets (in our case, UTF-8), so it's not a > practical problem. > > > If I’m not missing anything, here’s the corresponding patch: > > I'll look it over again before committing, but I don't see anything > immediately wrong with it. Thanks! BTW as a new contributor would you like to be credited as commit author (includes name/email) in the git log or just by name in the commit message (or not at all)? Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8542 Path: news.gmane.org!not-for-mail From: Julien Ramseier Newsgroups: gmane.linux.lib.musl.general Subject: Re: localeconv and char values Date: Tue, 22 Sep 2015 09:37:11 +0200 Message-ID: <709CC4DB-33BF-4228-99D7-A4A2CE36167B@gmail.com> References: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> <20150921145425.GQ17773@brightrain.aerifal.cx> <20150921202333.GS17773@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_26103F6F-3A01-43D8-A001-CC8AC7A72C57" X-Trace: ger.gmane.org 1442907456 16014 80.91.229.3 (22 Sep 2015 07:37:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Sep 2015 07:37:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8554-gllmg-musl=m.gmane.org@lists.openwall.com Tue Sep 22 09:37:33 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZeI8q-0001oQ-Lh for gllmg-musl@m.gmane.org; Tue, 22 Sep 2015 09:37:32 +0200 Original-Received: (qmail 21946 invoked by uid 550); 22 Sep 2015 07:37:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21921 invoked from network); 22 Sep 2015 07:37:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=y3k/JaFVazOFonvLXXanQhJdZ9y3odeppHlgUMH7fT4=; b=x8vQwPbOarSnnDh+pNRHIV/D8/aBrADxh1gN6VGAbA0dCnsk2kW+H5c3FWN/+nLCyZ PQX1MqCwqlYL5srPTU9qOlbfL2CX4DJsKvxUovb/ZujZo5vsFe2on32MvMCuZy6sE+yA UUUwaoT6EIUmrd+Y+HZrJ9zAR6eizuta0e3CXh7J+/sKFzo0c4G8RotYg94W5ntRkfxT VUJPJqTqfSVIxWdBx6VJJwXuc69aGL1dNGQukSYYXYd4kKZnCapAgzIilbOHQeOHI66s aJNA+NvHd3k13/OwkdJS2S5exiAu4SDzpgAsfvcp3k4k078nBVBv/xY015kjdevRb/r8 1mGg== X-Received: by 10.180.91.131 with SMTP id ce3mr18784871wib.84.1442907433212; Tue, 22 Sep 2015 00:37:13 -0700 (PDT) In-Reply-To: <20150921202333.GS17773@brightrain.aerifal.cx> X-Mailer: Apple Mail (2.2102) Xref: news.gmane.org gmane.linux.lib.musl.general:8542 Archived-At: --Apple-Mail=_26103F6F-3A01-43D8-A001-CC8AC7A72C57 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 21 sept. 2015 =C3=A0 22:23, Rich Felker a =C3=A9cri= t : >=20 > BTW as a new contributor would you like to be credited as commit > author (includes name/email) in the git log or just by name in the > commit message (or not at all)? What=E2=80=99s easier for you. Not at all is also fine. -- Julien= --Apple-Mail=_26103F6F-3A01-43D8-A001-CC8AC7A72C57 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Le 21 sept. 2015 =C3=A0 22:23, Rich Felker <dalias@libc.org> a = =C3=A9crit :

BTW as a new contributor = would you like to be credited as commit
author (includes name/email) in the git log or = just by name in the
commit message (or not at = all)?

What=E2=80=99s easier for you. Not at all is also = fine.

--
Julien
= --Apple-Mail=_26103F6F-3A01-43D8-A001-CC8AC7A72C57-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8555 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: localeconv and char values Date: Thu, 24 Sep 2015 02:45:30 -0400 Message-ID: <20150924064530.GI17773@brightrain.aerifal.cx> References: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> <20150921145425.GQ17773@brightrain.aerifal.cx> <20150921202333.GS17773@brightrain.aerifal.cx> <709CC4DB-33BF-4228-99D7-A4A2CE36167B@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1443077148 29561 80.91.229.3 (24 Sep 2015 06:45:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2015 06:45:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8567-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 24 08:45:45 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Zf0Ho-0005w6-L2 for gllmg-musl@m.gmane.org; Thu, 24 Sep 2015 08:45:44 +0200 Original-Received: (qmail 13339 invoked by uid 550); 24 Sep 2015 06:45:42 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 13321 invoked from network); 24 Sep 2015 06:45:42 -0000 Content-Disposition: inline In-Reply-To: <709CC4DB-33BF-4228-99D7-A4A2CE36167B@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8555 Archived-At: On Tue, Sep 22, 2015 at 09:37:11AM +0200, Julien Ramseier wrote: > > > Le 21 sept. 2015 à 22:23, Rich Felker a écrit : > > > > BTW as a new contributor would you like to be credited as commit > > author (includes name/email) in the git log or just by name in the > > commit message (or not at all)? > > What’s easier for you. Not at all is also fine. Committed. Thanks again for finding this! Rich