glibc/locale
Carlos O'Donell 1d8e3a2c66 localedef: Fix handling of empty mon_decimal_point (Bug 28847)
The handling of mon_decimal_point is incorrect when it comes to
handling the empty "" value.  The existing parser in monetary_read()
will correctly handle setting the non-wide-character value and the
wide-character value e.g. STR_ELEM_WC(mon_decimal_point) if they are
set in the locale definition.  However, in monetary_finish() we have
conflicting TEST_ELEM() which sets a default value (if the locale
definition doesn't include one), and subsequent code which looks for
mon_decimal_point to be NULL to issue a specific error message and set
the defaults. The latter is unused because TEST_ELEM() always sets a
default.  The simplest solution is to remove the TEST_ELEM() check,
and allow the existing check to look to see if mon_decimal_point is
NULL and set an appropriate default.  The final fix is to move the
setting of mon_decimal_point_wc so it occurs only when
mon_decimal_point is being set to a default, keeping both values
consistent. There is no way to tell the difference between
mon_decimal_point_wc having been set to the empty string and not
having been defined at all, for that distinction we must use
mon_decimal_point being NULL or "", and so we must logically set
the default together with mon_decimal_point.

Lastly, there are more fixes similar to this that could be made to
ld-monetary.c, but we avoid that in order to fix just the code
required for mon_decimal_point, which impacts the ability for C.UTF-8
to set mon_decimal_point to "", since without this fix we end up with
an inconsistent setting of mon_decimal_point set to "", but
mon_decimal_point_wc set to "." which is incorrect.

Tested on x86_64 and i686 without regression.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-02-01 11:12:17 -05:00
..
bits Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
programs localedef: Fix handling of empty mon_decimal_point (Bug 28847) 2022-02-01 11:12:17 -05:00
tst-localedef-path-norm.root localedef: Add verbose messages for failure paths. 2020-04-26 13:55:58 -04:00
broken_cur_max.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C_name.c Update. 2001-04-06 17:49:18 +00:00
C-address.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-collate-seq.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-collate.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-ctype.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-identification.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-measurement.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-messages.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-monetary.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-name.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-numeric.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-paper.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-telephone.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-time.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
C-translit.h.in Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
categories.def Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
coll-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
coll-lookup.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
duplocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
elem-hash.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
findlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
freelocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
gen-translit.py Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
global-locale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
hashval.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
indigits.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
indigitswc.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
iso-639.def Add mnw language code [BZ #25139] 2019-11-06 08:15:16 +01:00
iso-3166.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
iso-4217.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
langinfo.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-address.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-collate.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-ctype.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-identification.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-measurement.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-messages.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-monetary.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-name.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-numeric.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-paper.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-telephone.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
lc-time.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
loadarchive.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
loadlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locale.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
localeconv.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
localeinfo.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
localename.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
locarchive.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Makefile Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
mb_cur_max.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
newlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nl_langinfo_l.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nl_langinfo.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
outdigits.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
outdigitswc.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
setlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strlen-hash.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
SYS_libc.c [BZ #284, BZ #721] 2005-02-17 01:19:55 +00:00
tst-C-locale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-duplocale.c Add missing test files. 2009-11-17 16:23:57 -08:00
tst-locale-locpath.sh Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-localedef-path-norm.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-locname.c Add missing test files. 2009-11-17 16:23:57 -08:00
uselocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Versions * sysdeps/ia64/dl-fptr.c (__ia64_make_fptr): Revert last change. 2003-03-03 09:45:25 +00:00
weight.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
weightwc.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xlocale.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00