summaryrefslogtreecommitdiffstats
path: root/gettext-runtime/libasprintf
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2010-11-07 18:57:08 +0100
committerBruno Haible <bruno@clisp.org>2011-06-07 23:38:48 +0200
commit12452d87fefaf31cce1b9206e663defa27197a40 (patch)
tree1411273b114fab57e0b1483adee48e723efb1416 /gettext-runtime/libasprintf
parente50ff28661d748f1c571d89ffd10ebe58eb78569 (diff)
downloadexternal_gettext-12452d87fefaf31cce1b9206e663defa27197a40.zip
external_gettext-12452d87fefaf31cce1b9206e663defa27197a40.tar.gz
external_gettext-12452d87fefaf31cce1b9206e663defa27197a40.tar.bz2
vasnprintf: Support I flag on glibc systems.
Diffstat (limited to 'gettext-runtime/libasprintf')
-rw-r--r--gettext-runtime/libasprintf/ChangeLog8
-rw-r--r--gettext-runtime/libasprintf/printf-parse.c7
-rw-r--r--gettext-runtime/libasprintf/printf-parse.h3
-rw-r--r--gettext-runtime/libasprintf/vasnprintf.c4
4 files changed, 22 insertions, 0 deletions
diff --git a/gettext-runtime/libasprintf/ChangeLog b/gettext-runtime/libasprintf/ChangeLog
index 8a38e51..50f619f 100644
--- a/gettext-runtime/libasprintf/ChangeLog
+++ b/gettext-runtime/libasprintf/ChangeLog
@@ -1,5 +1,13 @@
2010-11-07 Bruno Haible <bruno@clisp.org>
+ vasnprintf: Support I flag on glibc systems.
+ * printf-parse.h (FLAG_LOCALIZED): New macro.
+ * printf-parse.c (PRINTF_PARSE): Handle the 'I' flag.
+ * vasnprintf.c (VASNPRINTF): Pass the 'I' flag on to the system's
+ snprintf function.
+
+2010-11-07 Bruno Haible <bruno@clisp.org>
+
Rename autosprintf.h.in to autosprintf.in.h.
* autosprintf.in.h: New file, renamed from autosprintf.h.in.
* Makefile.am (autosprintf.h, EXTRA_DIST): Update.
diff --git a/gettext-runtime/libasprintf/printf-parse.c b/gettext-runtime/libasprintf/printf-parse.c
index 3f3174d..5fe8da6 100644
--- a/gettext-runtime/libasprintf/printf-parse.c
+++ b/gettext-runtime/libasprintf/printf-parse.c
@@ -207,6 +207,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
dp->flags |= FLAG_ZERO;
cp++;
}
+#if __GLIBC__ >= 2
+ else if (*cp == 'I')
+ {
+ dp->flags |= FLAG_LOCALIZED;
+ cp++;
+ }
+#endif
else
break;
}
diff --git a/gettext-runtime/libasprintf/printf-parse.h b/gettext-runtime/libasprintf/printf-parse.h
index 51ead29..82e5359 100644
--- a/gettext-runtime/libasprintf/printf-parse.h
+++ b/gettext-runtime/libasprintf/printf-parse.h
@@ -29,6 +29,9 @@
#define FLAG_SPACE 8 /* space flag */
#define FLAG_ALT 16 /* # flag */
#define FLAG_ZERO 32
+#if __GLIBC__ >= 2
+# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */
+#endif
/* arg_index value indicating that no argument is consumed. */
#define ARG_NONE (~(size_t)0)
diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c
index 3dd8b3f..55dbb27 100644
--- a/gettext-runtime/libasprintf/vasnprintf.c
+++ b/gettext-runtime/libasprintf/vasnprintf.c
@@ -4753,6 +4753,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
*fbp++ = ' ';
if (flags & FLAG_ALT)
*fbp++ = '#';
+#if __GLIBC__ >= 2
+ if (flags & FLAG_LOCALIZED)
+ *fbp++ = 'I';
+#endif
if (!pad_ourselves)
{
if (flags & FLAG_ZERO)