Commit 4363c7a1 by Jerry DeLisle

re PR fortran/45710 (Adjust format and padding for WRITE of NAMELIST group to internal file)

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.

From-SVN: r164543
parent 7d98865e
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> 2010-09-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/45723 PR libfortran/45723
......
...@@ -1630,6 +1630,20 @@ namelist_write_newline (st_parameter_dt *dtp) ...@@ -1630,6 +1630,20 @@ namelist_write_newline (st_parameter_dt *dtp)
{ {
gfc_offset record; gfc_offset record;
int finished; 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, /* Now that the current record has been padded out,
determine where the next record in the array is. */ determine where the next record in the array is. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment