From owner-cvs-src-old@FreeBSD.ORG Wed Feb 10 00:02:37 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4188A1065697 for ; Wed, 10 Feb 2010 00:02:37 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2F8898FC0A for ; Wed, 10 Feb 2010 00:02:37 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A02b1P008894 for ; Wed, 10 Feb 2010 00:02:37 GMT (envelope-from cracauer@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o1A02bNW008893 for cvs-src-old@freebsd.org; Wed, 10 Feb 2010 00:02:37 GMT (envelope-from cracauer@repoman.freebsd.org) Message-Id: <201002100002.o1A02bNW008893@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to cracauer@repoman.freebsd.org using -f From: Martin Cracauer Date: Wed, 10 Feb 2010 00:02:09 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libc/stdlib strfmon.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 00:02:37 -0000 cracauer 2010-02-10 00:02:09 UTC FreeBSD src repository Modified files: lib/libc/stdlib strfmon.c Log: SVN rev 203734 on 2010-02-10 00:02:09Z by cracauer Fix PR http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/143350 Empty string test gone wrong. Testing this requires that you have a locale that has the sign string unset but has int_n_sign_posn set (the default locale falls through to use "()" around negative numbers which is probably another bug). I created that setup by hand and indeed without this fix negative numbers are put out as positive numbers (doesn't fall through to use "-" as default indicator). Unfixed example in nl_NL.ISO8859-1 with lc->negative_sign set to empty string: strfmon(buf, sizeof(buf), "%-8i", -42.0); ==> example2: 'EUR 42,00' 'Eu 42,00' Fixed: example2: 'EUR 42,00-' 'Eu 42,00-' This file and suggested fix are identical in at least freebsd-8. Backport might be appropriate but some expert on locales should probably have a look at us defaulting to negative numbers in parenthesis when LC_* is default. That doesn't look right and is not what other OSes are doing. PR: 143350 Submitted by: Corinna Vinschen Reviewed by: bug reporter submitted, tested by me Revision Changes Path 1.20 +2 -2 src/lib/libc/stdlib/strfmon.c