bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'vasnprintf-posix'


From: Bruno Haible
Subject: Re: new module 'vasnprintf-posix'
Date: Sat, 10 Mar 2007 01:21:48 +0100
User-agent: KMail/1.5.4

Here's a small fix for internationalization.

2007-03-09  Bruno Haible  <address@hidden>

        * lib/vasnprintf.c (VASNPRINTF): For the 'a' and 'A' directives, use
        a locale dependent decimal point, rather than always '.'.

*** lib/vasnprintf.c    5 Mar 2007 03:14:53 -0000       1.25
--- lib/vasnprintf.c    10 Mar 2007 00:18:39 -0000
***************
*** 34,39 ****
--- 34,40 ----
  # include "vasnprintf.h"
  #endif
  
+ #include <locale.h>   /* localeconv() */
  #include <stdio.h>    /* snprintf(), sprintf() */
  #include <stdlib.h>   /* abort(), malloc(), realloc(), free() */
  #include <string.h>   /* memcpy(), strlen() */
***************
*** 492,498 ****
                              if ((flags & FLAG_ALT)
                                  || mantissa > 0.0L || precision > 0)
                                {
!                                 *p++ = '.';
                                  /* This loop terminates because we assume
                                     that FLT_RADIX is a power of 2.  */
                                  while (mantissa > 0.0L)
--- 493,503 ----
                              if ((flags & FLAG_ALT)
                                  || mantissa > 0.0L || precision > 0)
                                {
!                                 const char *point =
!                                   localeconv () -> decimal_point;
!                                 /* The decimal point is always a single byte:
!                                    either '.' or ','.  */
!                                 *p++ = (point[0] != '\0' ? point[0] : '.');
                                  /* This loop terminates because we assume
                                     that FLT_RADIX is a power of 2.  */
                                  while (mantissa > 0.0L)
***************
*** 636,642 ****
                              if ((flags & FLAG_ALT)
                                  || mantissa > 0.0 || precision > 0)
                                {
!                                 *p++ = '.';
                                  /* This loop terminates because we assume
                                     that FLT_RADIX is a power of 2.  */
                                  while (mantissa > 0.0)
--- 641,651 ----
                              if ((flags & FLAG_ALT)
                                  || mantissa > 0.0 || precision > 0)
                                {
!                                 const char *point =
!                                   localeconv () -> decimal_point;
!                                 /* The decimal point is always a single byte:
!                                    either '.' or ','.  */
!                                 *p++ = (point[0] != '\0' ? point[0] : '.');
                                  /* This loop terminates because we assume
                                     that FLT_RADIX is a power of 2.  */
                                  while (mantissa > 0.0)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]