From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18553 invoked by alias); 20 Jul 2005 19:07:31 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18073 invoked by alias); 20 Jul 2005 19:07:26 -0000 Date: Wed, 20 Jul 2005 19:11:00 -0000 Message-ID: <20050720190726.18070.qmail@sourceware.org> From: "paulthomas2 at wanadoo dot fr" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050720153355.22570.dir@lanl.gov> References: <20050720153355.22570.dir@lanl.gov> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libfortran/22570] Null Characters instead of blanks in text output. X-Bugzilla-Reason: CC X-SW-Source: 2005-07/txt/msg02436.txt.bz2 List-Id: ------- 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 > 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 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 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22570