This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Properly display unavailable elements in LC_MONETARY category
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 13 Nov 2013 10:58:51 +0100
- Subject: Re: [PATCH] Properly display unavailable elements in LC_MONETARY category
- Authentication-results: sourceware.org; auth=none
- References: <mvmd2m5ri7o dot fsf at hawking dot suse dot de>
On Tue, Nov 12, 2013 at 12:07:55PM +0100, Andreas Schwab wrote:
> On architectures with unsigned characters the elements were displayed as
> 255 instead of -1.
>
This puzzles me, it seems to revert part of following commit:
2003-04-27 Ulrich Drepper <drepper@redhat.com>
* nscd/connections.c (client_queued): New variable.
(nscd_run): Revamp the loop. Don't call poll except for cleanup
threads. Keep track of the number of delays caused because of busy
worker threads.
* nscd/nscd.h: Declare client_queued.
* nscd/nscd_stat.c: Transmit and print client_queued information.
* locale/programs/locale.c (show_info): Use '\177' instead of CHAR_MAX.
* Makerules ($(common-objpfx)shlib.lds): Don't use PROVIDE to
define __start_libc_freeres_ptrs and __stop___libc_freeres_ptrs.
Also locale/programs/ld-monetary.c uses \177.
This is consistent with locale/C-monetary.c which defines unavailable
based on if char is signed or unsigned.
If these issues are clarified a patch is ok.
> Andreas.
>
> * locale/programs/locale.c (show_info): Check for CHAR_MAX instead
> of '\177'.
> ---
> locale/programs/locale.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/locale/programs/locale.c b/locale/programs/locale.c
> index 14d34e6..4f8734c 100644
> --- a/locale/programs/locale.c
> +++ b/locale/programs/locale.c
> @@ -895,7 +895,7 @@ show_info (const char *name)
> printf ("%s=", item->name);
>
> if (val != NULL)
> - printf ("%d", *val == '\177' ? -1 : *val);
> + printf ("%d", *val == CHAR_MAX ? -1 : *val);
> putchar ('\n');
> }
> break;
> @@ -909,12 +909,12 @@ show_info (const char *name)
>
> while (cnt > 1)
> {
> - printf ("%d;", *val == '\177' ? -1 : *val);
> + printf ("%d;", *val == CHAR_MAX ? -1 : *val);
> --cnt;
> ++val;
> }
>
> - printf ("%d\n", cnt == 0 || *val == '\177' ? -1 : *val);
> + printf ("%d\n", cnt == 0 || *val == CHAR_MAX ? -1 : *val);
> }
> break;
> case word:
> --
> 1.8.4.3
>
> --