diff mbox

PR52251

Message ID 56524315.5090305@charter.net
State New
Headers show

Commit Message

Jerry DeLisle Nov. 22, 2015, 10:35 p.m. UTC
Another old patch I forgot about.  This one is fairly self explanatory.  We were
not handling pending spaces for ADVANCE_NO and T editing.

Regression tested x86-64-linux.  New test case.

OK for trunk?

Jerry


2015-11-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/52251
	* io/transfer.c (formatted_transfer_scalar_write): Reset skips count.
	(finalize_transfer): For ADVANCE_NO, emit pending spaces and reset the
	skip count.

Comments

Steve Kargl Nov. 22, 2015, 10:59 p.m. UTC | #1
On Sun, Nov 22, 2015 at 02:35:01PM -0800, Jerry DeLisle wrote:
> Another old patch I forgot about.  This one is fairly self
> explanatory.  We were not handling pending spaces for
> ADVANCE_NO and T editing.
> 
> Regression tested x86-64-linux.  New test case.
> 
> OK for trunk?
> 

Looks ok to me.
diff mbox

Patch

--- transfer.c	(revision 225410)
+++ transfer.c	(working copy)
@@ -1641,6 +1641,7 @@  formatted_transfer_scalar_write (st_parameter_dt *
 			  - dtp->u.p.current_unit->bytes_left);
 	      dtp->u.p.max_pos = 
 		dtp->u.p.max_pos > tmp ? dtp->u.p.max_pos : tmp;
+	      dtp->u.p.skips = 0;
 	    }
 	  if (dtp->u.p.skips < 0)
 	    {
@@ -3600,6 +3601,16 @@  finalize_transfer (st_parameter_dt *dtp)
      next I/O operation if needed.  */
   if (dtp->u.p.advance_status == ADVANCE_NO)
     {
+      if (dtp->u.p.skips > 0)
+	{
+	  int tmp;
+	  write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
+	  tmp = (int)(dtp->u.p.current_unit->recl
+		      - dtp->u.p.current_unit->bytes_left);
+	  dtp->u.p.max_pos = 
+	    dtp->u.p.max_pos > tmp ? dtp->u.p.max_pos : tmp;
+	  dtp->u.p.skips = 0;
+	}
       int bytes_written = (int) (dtp->u.p.current_unit->recl
 	- dtp->u.p.current_unit->bytes_left);
       dtp->u.p.current_unit->saved_pos =