]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
vasnprintf: Support I flag on glibc systems.
authorBruno Haible <bruno@clisp.org>
Sun, 7 Nov 2010 17:57:08 +0000 (18:57 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 7 Jun 2011 21:38:48 +0000 (23:38 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/printf-parse.c
gettext-runtime/intl/printf-parse.h
gettext-runtime/intl/vasnprintf.c
gettext-runtime/libasprintf/ChangeLog
gettext-runtime/libasprintf/printf-parse.c
gettext-runtime/libasprintf/printf-parse.h
gettext-runtime/libasprintf/vasnprintf.c

index d021ef51ab3c5fd2e35fb64da315c7c23bac8d94..76b0f49b636104c76cf8b693b3269395a3cd24c2 100644 (file)
@@ -1,3 +1,11 @@
+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 libgnuintl.h.in to libgnuintl.in.h.
index 3f3174d06e0bdebce22f015ab2d6317d8f9f72ac..5fe8da6739c9ce5c683d5b42acf56ae5618c541a 100644 (file)
@@ -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;
             }
index 51ead29ec40be0dfe085bb7caf642c01a4d60c3a..82e5359b63dad0e928856e245fe33a43500a51c5 100644 (file)
@@ -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)
index 3dd8b3f304b99f78d5408eb281e35f12fc89b198..55dbb27af5044f81cab6078a097f003f6069b996 100644 (file)
@@ -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)
index 8a38e514e586faa215d52497ceebb92eb674a62f..50f619f2c42e5af45ae05fd273ff92b5aaa5da74 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 3f3174d06e0bdebce22f015ab2d6317d8f9f72ac..5fe8da6739c9ce5c683d5b42acf56ae5618c541a 100644 (file)
@@ -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;
             }
index 51ead29ec40be0dfe085bb7caf642c01a4d60c3a..82e5359b63dad0e928856e245fe33a43500a51c5 100644 (file)
@@ -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)
index 3dd8b3f304b99f78d5408eb281e35f12fc89b198..55dbb27af5044f81cab6078a097f003f6069b996 100644 (file)
@@ -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)