[patch, libgfortran] Final patch for PR29277, LF conversion to CR-LF

Jerry DeLisle jvdelisle@verizon.net
Wed Oct 18 12:19:00 GMT 2006


:ADDPATCH fortran:

The attached patch implements requirements in F2003 10.6.3 regarding handling of 
NEWLINE in FORMATTED STREAM I/O.  The patch is fairly self explanatory.  In 
systems with #define HAVE_CRLF we must scan the string for instances of '\n' and 
write out a '\r\n' instead.

The attached patch, of necessity, must write the string in chunks broken up by 
any embedded '\n' characters.

I have regression tested this two ways.  Without #define HAVE_CRLF which is 
normal on my system (i686-linux) and with #define HAVE_CRLF manually inserted at 
the top of transfer.c and write.c.  Both cases pass regression testing.

Danny would you mind testing on mingw.  Would someone offer to review this 
please.  In parallel, I will generate an additional test case.  The attached 
test case is an example for all to see.  It gives interesting results, and I 
believe it is correct.

OK for 4.2.  I have an email to Mark Mitchell to make sure he is OK with 
committing this, provided it gets a review.

Regards,

Jerry

2006-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/29277
	* io/write.c (write_a): Add conversion of LF to LF-CR for systems with
	#define HAVE_CRLF.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr29277-2.diff
Type: text/x-patch
Size: 2214 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061018/f5cc4d3b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: short_test.f90
Type: text/x-fortran
Size: 482 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061018/f5cc4d3b/attachment-0001.bin>


More information about the Fortran mailing list