On 04/13/12 03:18 PM, Petr Sumbera wrote:
Problem 2:
==========
bash -c 'printf "x%+010.0fx\n" 123'
x000000+123x
where it should be:
x+000000123x
Fixed in chunk #3 (but the problem is there also for other types!).
My fix breaks following case:
bash -c 'printf "x%+10.0fx\n" 123'
x+ 123x
where it should be
x +123x
So this would be probably fixed in my original patch (chunk #3) with
following code:
if (p->pad == ' ')
{
PAD_RIGHT(p);
PUT_PLUS(d, p, 0.);
} else {
if (*tmp == '-')
PUT_CHAR(*tmp++, p);
PUT_PLUS(d, p, 0.);
PAD_RIGHT(p);
}
PUT_SPACE(d, p, 0.);
--
Petr