[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] improve locale handling in m4/wcwidth.m4
From: |
kc . REMOVE . SPAM |
Subject: |
[PATCH] improve locale handling in m4/wcwidth.m4 |
Date: |
Mon, 13 Jul 2009 21:33:24 +0200 |
User-agent: |
Opera Mail/9.64 (Linux) |
Hello,
the attached patch solves two problems with the current version of
m4/wcwidth.m4 (serial 14). However, those two problems are so closely
related that I chose to attack them in one patch.
The current version of gl_FUNC_WCWIDTH in m4/wcwidth.m4 tries to switch to
an UTF-8 locale by switching to "fr_FR.UTF-8".
The first problem arises if the setlocale command fails (returning NULL).
Then the actual test is not executed and the main function returns 0. This
value indicates properly working wcwidth with UTF-8 locale. However, the
test did not take place, as setlocale failed.
The first problem is the hard-coded locale name "fr_FR.UTF-8". I'd suppose
using $LOCALE_FR_UTF8 from gt_LOCALE_FR_UTF8 is a saner choice.
I followed the lead of other gnulib m4 files (e.g.: m4/mbrlen.m4) and put
a guard for "$LOCALE_FR_UTF8 = none" around the AC_TRY_RUN. Furthermore, I
sanitized the C programs main return value if setlocale failed.
Kind regards,
kc
--
Do _not_ remove the ".REMOVE.SPAM" in the address.
It's a catch for too smart address harvesters
wcwidth-locale.patch
Description: Binary data
- [PATCH] improve locale handling in m4/wcwidth.m4,
kc . REMOVE . SPAM <=
- Re: [PATCH] improve locale handling in m4/wcwidth.m4, Bruno Haible, 2009/07/13
- Re: [PATCH] improve locale handling in m4/wcwidth.m4, kc . REMOVE . SPAM, 2009/07/14
- Re: [PATCH] improve locale handling in m4/wcwidth.m4, Bruno Haible, 2009/07/14
- Re: [PATCH] improve locale handling in m4/wcwidth.m4, Eric Blake, 2009/07/14
- Re: Cygwin 1.7 wide char functions, Bruno Haible, 2009/07/14
- Re: Cygwin 1.7 wide char functions, Bruno Haible, 2009/07/18
- Re: Cygwin 1.7 wide char functions, Eric Blake, 2009/07/20
- Re: Cygwin 1.7 wide char functions, Eric Blake, 2009/07/20
- Re: Cygwin 1.7 wide char functions, Bruno Haible, 2009/07/20
- Re: Cygwin 1.7 wide char functions, Eric Blake, 2009/07/20