* [PATCH] PR52251
@ 2015-11-22 22:59 Jerry DeLisle
2015-11-22 23:00 ` Steve Kargl
0 siblings, 1 reply; 2+ messages in thread
From: Jerry DeLisle @ 2015-11-22 22:59 UTC (permalink / raw)
To: gfortran; +Cc: gcc patches
[-- Attachment #1: Type: text/plain, Size: 442 bytes --]
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.
[-- Attachment #2: tab.diff --]
[-- Type: text/x-patch, Size: 939 bytes --]
--- 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 =
[-- Attachment #3: fmt_t_8.f90 --]
[-- Type: text/x-fortran, Size: 179 bytes --]
! { dg-do run }
! PR52251 Tabs with advance = 'no'
write( *, '( t25 )', advance = 'no' )
write( *, '( "hello" )' ) ! { dg-output " hello(\n|\r\n|\r)" }
end
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] PR52251
2015-11-22 22:59 [PATCH] PR52251 Jerry DeLisle
@ 2015-11-22 23:00 ` Steve Kargl
0 siblings, 0 replies; 2+ messages in thread
From: Steve Kargl @ 2015-11-22 23:00 UTC (permalink / raw)
To: Jerry DeLisle; +Cc: gfortran, gcc patches
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.
--
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-22 22:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-22 22:59 [PATCH] PR52251 Jerry DeLisle
2015-11-22 23:00 ` Steve Kargl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).