This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Bug libfortran/22570] Null Characters instead of blanks in textoutput.
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: pault at gcc dot gnu dot org, fortran at gcc dot gnu dot org,Steven Bosscher <stevenb at suse dot de>
- Date: Wed, 20 Jul 2005 21:07:09 +0200
- Subject: Re: [Bug libfortran/22570] Null Characters instead of blanks in textoutput.
- References: <20050720153355.22570.dir@lanl.gov> <20050720154200.23358.qmail@sourceware.org>
pinskia at gcc dot gnu dot org wrote:
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-20 15:41 -------
Confirmed, I think this was caused by:
2005-07-12 Paul Thomas <pault@gcc.gnu.org>
Guilty, as charged.
Please find attached, ChangeLog entries, patch, the output that was
incorrect and now looks the same as ifc, plus a testcase.
I just never checked what slash editing did to the position counters.
duuuh!
Regtests OK on RH9.
OK for mainline and 4.0?
Paul T
PS Steven, it's not so much a one spacer but a one liner...
2005-07-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/22570
* transfer.c (formatted_transfer): Correct the problem
with X- editting due to slashes not zeroing the space
and maximum position counters.
.
PR fortran/22570
* gfortran.dg/x_slash.f: New Test.
Index: gcc/libgfortran/io/transfer.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/transfer.c,v
retrieving revision 1.48
diff -c -3 -p -r1.48 transfer.c
*** gcc/libgfortran/io/transfer.c 14 Jul 2005 06:21:58 -0000 1.48
--- gcc/libgfortran/io/transfer.c 20 Jul 2005 17:57:48 -0000
*************** formatted_transfer (bt type, void *p, in
*** 776,781 ****
--- 776,782 ----
case FMT_SLASH:
consume_data_flag = 0 ;
+ max_pos = skips = pending_spaces = 0;
next_record (0);
break;
Now results in......
1
********************************************************************************************
********************************************************************************************
**
**
**
**
**
**
**
**
**
** aaaaaaaaaa ddddddddd
iiiiiiiiiiii nn nn aaaaaaaaaa **
** aaaaaaaaaaaa dddddddddd
iiiiiiiiiiii nnn nn aaaaaaaaaaaa **
** aa aa dd dd
ii nnnn nn aa aa **
** aa aa dd dd
ii nn nn nn aa aa **
** aa aa dd dd
ii nn nn nn aa aa **
** aaaaaaaaaaaa dd dd
ii nn nn nn aaaaaaaaaaaa **
Test case
c { dg-do run }
c This program tests the fix to PR22570.
c
c provided by Paul Thomas - pault@gcc.gnu.org
c
program x_slash
character*60 a
open (10, status="scratch")
write (10, 100)
100 format (1h1,59x,1h*,/,60x,/,58x,1h*,/)
rewind (10)
read (10, 200) a
read (10, 200) a
read (10, 200) a
200 format (a60)
close (10)
if (ichar(a(10:10)).ne.32) call abort ()
end