diff options
author | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 14:20:10 +0000 |
---|---|---|
committer | fxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 14:20:10 +0000 |
commit | 796e5f20b61e2b5217c3bd10df4041ee5707bd0f (patch) | |
tree | f31db877f1ff6847fae7b39c30d10d28a04bed21 /libgfortran/io | |
parent | 4a5c037c49615199368744b96f399ca51f54c539 (diff) | |
download | gcc-796e5f20b61e2b5217c3bd10df4041ee5707bd0f.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97627 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/write.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 556adea268b..d97caec8bc7 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); |