# HG changeset patch # User Richard M. Stallman # Date 726884703 0 # Node ID 94ff5d9ef48ad7a7368d0a944ff8044762afcf6e # Parent 65e858c07a8b140ac7d117056a236f9bff6b1920 (float_to_string): Add final 0 if text ends with decimal pt. diff -r 65e858c07a8b -r 94ff5d9ef48a src/print.c --- a/src/print.c Tue Jan 12 00:12:21 1993 +0000 +++ b/src/print.c Wed Jan 13 00:25:03 1993 +0000 @@ -640,12 +640,18 @@ sprintf (buf, XSTRING (Vfloat_output_format)->data, data); } - /* Make sure there is a decimal point or an exponent, + /* Make sure there is a decimal point with digit after, or an exponent, so that the value is readable as a float. */ for (cp = buf; *cp; cp++) if (*cp < '0' || *cp > '9') break; + if (*cp == '.' && cp[1] == 0) + { + cp[1] = '0'; + cp[2] = 0; + } + if (*cp == 0) { *cp++ = '.';