+2007-03-09 Bruno Haible <bruno@clisp.org>
+
+ * lib/vasnprintf.c (VASNPRINTF): For the 'a' and 'A' directives, use
+ a locale dependent decimal point, rather than always '.'.
+
2007-03-09 Eric Blake <ebb9@byu.net>
* lib/stdlib_.h (EXIT_FAILURE): GNU code expects this to be 1, in
# 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() */
if ((flags & FLAG_ALT)
|| mantissa > 0.0L || precision > 0)
{
- *p++ = '.';
+ 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)
if ((flags & FLAG_ALT)
|| mantissa > 0.0 || precision > 0)
{
- *p++ = '.';
+ 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)