aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/write.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2015-02-07 15:13:15 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2015-02-07 15:13:15 +0000
commit1060d9404d1ab275b540efe1c7868d08c07a81e1 (patch)
tree81fec064d6dc7d20671ba02ca25c864dc9cec2f8 /libgfortran/io/write.c
parentc0c91386b7ebd2c241d6ee2d5c172e57f5185472 (diff)
downloadgcc-1060d9404d1ab275b540efe1c7868d08c07a81e1.zip
gcc-1060d9404d1ab275b540efe1c7868d08c07a81e1.tar.gz
gcc-1060d9404d1ab275b540efe1c7868d08c07a81e1.tar.bz2
re PR fortran/60956 (error reading (and writing) large text files in gfortran)
2015-02-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/60956 * io/fbuf.c (fbuf_flush_list): New function that only flushes if current fbuf position exceeds a limit. * io/fbuf.h: Declare the new function. * io/io.h (enum unit_mode): Add two new modes. * io/list_read.c (list_formatted_read_scalar): Call new function. * io/write.c: Include fbuf.h. (list_formatted_write_scalar): Call new function. From-SVN: r220505
Diffstat (limited to 'libgfortran/io/write.c')
-rw-r--r--libgfortran/io/write.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 2149456..3e890b9 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#include "io.h"
+#include "fbuf.h"
#include "format.h"
#include "unix.h"
#include <assert.h>
@@ -1585,6 +1586,7 @@ list_formatted_write_scalar (st_parameter_dt *dtp, bt type, void *p, int kind,
internal_error (&dtp->common, "list_formatted_write(): Bad type");
}
+ fbuf_flush_list (dtp->u.p.current_unit, LIST_WRITING);
dtp->u.p.char_flag = (type == BT_CHARACTER);
}