Index: write_float.def =================================================================== --- write_float.def (revision 230709) +++ write_float.def (working copy) @@ -514,12 +514,21 @@ output_float (st_parameter_dt *dtp, const fnode *f w = w == 1 ? 2 : w; } } - + /* Work out how much padding is needed. */ nblanks = w - (nbefore + nzero + nafter + edigits + 1); if (sign != S_NONE) nblanks--; + /* See if we have space for a zero before the decimal point. */ + if (nbefore == 0 && nblanks > 0) + { + leadzero = 1; + nblanks--; + } + else + leadzero = 0; + if (dtp->u.p.g0_no_blanks) { w -= nblanks; @@ -544,15 +553,6 @@ output_float (st_parameter_dt *dtp, const fnode *f return false; } - /* See if we have space for a zero before the decimal point. */ - if (nbefore == 0 && nblanks > 0) - { - leadzero = 1; - nblanks--; - } - else - leadzero = 0; - /* For internal character(kind=4) units, we duplicate the code used for regular output slightly modified. This needs to be maintained consistent with the regular code that follows this block. */