Eric Blake <ebb9 <at> byu.net> writes: > It looks like the solution is to also add > support at line 3149 (for long double) for the %a format
Like so. Bruno, okay to apply? (gmane probably botched this patch, so you can also see it at http://repo.or.cz/w/gnulib/ericb.git?a=shortlog;h=refs/heads/vasnprintf) From: Eric Blake <[EMAIL PROTECTED]> Date: Mon, 22 Sep 2008 12:15:03 -0600 Subject: [PATCH] vasnprintf: fix x86/glibc regression on printf("%La", 0.0L) * lib/vasnprintf.c (VASNPRINTF): Support 0.0 on platforms that supply %A but mishandle pseudo-NaN. Reported by Simon Josefsson. Signed-off-by: Eric Blake <[EMAIL PROTECTED]> --- ChangeLog | 9 ++++++++- lib/vasnprintf.c | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b06d29..ad7cefc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-22 Eric Blake <[EMAIL PROTECTED]> + + vasnprintf: fix x86/glibc regression on printf("%La", 0.0L) + * lib/vasnprintf.c (VASNPRINTF): Support 0.0 on platforms that + supply %A but mishandle pseudo-NaN. + Reported by Simon Josefsson. + 2008-09-21 Bruno Haible <[EMAIL PROTECTED]> * tests/test-lock.c (main): Tweak skip message. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index e4bfca3..19f28bc 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -3182,6 +3182,27 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, *p++ = '0'; } } + else if (dp->conversion == 'a' || dp->conversion == 'A') + { + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + *p++ = '0'; + if (!has_precision) + precision = 0; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + *p++ = dp->conversion - 'A' + 'P'; + *p++ = '+'; + *p++ = '0'; + } else abort (); # endif -- 1.6.0.2