------- Additional Comments From paulthomas2 at wanadoo dot fr  2005-07-20 
19:07 -------
Subject: Re:  Null Characters instead of blanks in text
 output.

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  <[EMAIL PROTECTED]>
>
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  <[EMAIL PROTECTED]>

    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 - [EMAIL PROTECTED]
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







-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22570

Reply via email to