diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-23 00:53:15 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-23 00:53:15 +0000 |
commit | e1022bf1f1d1664aa54ff6e2d8d02379fb4ca98b (patch) | |
tree | b85eb692b39a03aebcb50ccf00bbedaea7dd973b /libgfortran | |
parent | 29fa483ed3ddda279b62f7e4200cff0004062bc3 (diff) | |
download | gcc-e1022bf1f1d1664aa54ff6e2d8d02379fb4ca98b.tar.gz |
2010-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/45710
* io/write.c (namelist_write_newline): Pad character array internal
unit records with spaces.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164543 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/write.c | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 8411513a819..c462a2a5421 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2010-09-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/45710 + * io/write.c (namelist_write_newline): Pad character array internal + unit records with spaces. + 2010-09-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/45723 diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index e811c47baef..fabbaffc9e9 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -1630,6 +1630,20 @@ namelist_write_newline (st_parameter_dt *dtp) { gfc_offset record; int finished; + char *p; + int length = dtp->u.p.current_unit->bytes_left; + + p = write_block (dtp, length); + if (p == NULL) + return; + + if (unlikely (is_char4_unit (dtp))) + { + gfc_char4_t *p4 = (gfc_char4_t *) p; + memset4 (p4, ' ', length); + } + else + memset (p, ' ', length); /* Now that the current record has been padded out, determine where the next record in the array is. */ |