aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/write.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-04-05 16:20:10 +0200
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2005-04-05 14:20:10 +0000
commit51e9d74cb85e9640ce3958bb89fab245f44752c7 (patch)
treef31db877f1ff6847fae7b39c30d10d28a04bed21 /libgfortran/io/write.c
parent9e9126f35508e7078eeeac4e81ea76a7a37fa1af (diff)
downloadgcc-51e9d74cb85e9640ce3958bb89fab245f44752c7.zip
gcc-51e9d74cb85e9640ce3958bb89fab245f44752c7.tar.gz
gcc-51e9d74cb85e9640ce3958bb89fab245f44752c7.tar.bz2
re PR libfortran/20755 (gfortran - prints the same number with 1p4G12.3 two different ways)
PR libfortran/20755 * write.c (write_float): A G edit descriptor may locally change the scale factor, but it needs to be restored afterwards. * gfortran.dg/pr20755.f: New test. From-SVN: r97627
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r--libgfortran/io/write.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 556adea..d97caec 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -674,7 +674,7 @@ static void
write_float (fnode *f, const char *source, int len)
{
double n;
- int nb =0, res;
+ int nb =0, res, save_scale_factor;
char * p, fin;
fnode *f2 = NULL;
@@ -723,8 +723,10 @@ write_float (fnode *f, const char *source, int len)
}
else
{
+ save_scale_factor = g.scale_factor;
f2 = calculate_G_format(f, n, len, &nb);
output_float (f2, n, len);
+ g.scale_factor = save_scale_factor;
if (f2 != NULL)
free_mem(f2);