aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/transfer.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2017-12-03 16:47:12 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2017-12-03 16:47:12 +0000
commitc4508d0ad7fb8fe23517a6b5e874c4573fdec8a0 (patch)
tree20e444c84db177bd87ead91a4dd32bcdd4acf3c4 /libgfortran/io/transfer.c
parent7c731281574f7d89c6fed487fe646176603ad98f (diff)
downloadgcc-c4508d0ad7fb8fe23517a6b5e874c4573fdec8a0.zip
gcc-c4508d0ad7fb8fe23517a6b5e874c4573fdec8a0.tar.gz
gcc-c4508d0ad7fb8fe23517a6b5e874c4573fdec8a0.tar.bz2
re PR fortran/83191 (Writing a namelist with repeated complex numbers)
2017-12-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> Dominique d'Humieres <dominiq@lps.ens.fr> PR libgfortran/83191 * io/transfer.c (list_formatted_read_scalar): Do not set namelist_mode bit here. (namelist_read): Likewise. (data_transfer_init): Clear the mode bit here. (finalize_transfer): Do set the mode bit just before any calls to namelist_read or namelist_write. It can now be referred to in complex_write. ^ io/write.c (write_complex): Suppress the leading blanks when namelist_mode bit is not set to 1. * gfortran.dg/namelist_95.f90: New test. Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr> From-SVN: r255365
Diffstat (limited to 'libgfortran/io/transfer.c')
-rw-r--r--libgfortran/io/transfer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 5429a85..4d7ca7a 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -2671,7 +2671,7 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
dtp->u.p.ionml = ionml;
dtp->u.p.mode = read_flag ? READING : WRITING;
-
+ dtp->u.p.namelist_mode = 0;
dtp->u.p.cc.len = 0;
if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
@@ -3890,6 +3890,7 @@ finalize_transfer (st_parameter_dt *dtp)
if ((dtp->u.p.ionml != NULL)
&& (cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0)
{
+ dtp->u.p.namelist_mode = 1;
if ((cf & IOPARM_DT_NAMELIST_READ_MODE) != 0)
namelist_read (dtp);
else