Fixing CRLF issues

Andrew P. Black black at cs.pdx.edu
Tue May 8 07:05:15 UTC 2007


Subbu,

I think that you are right when you say "line endings is platform- 
specific (not filesystem specific). A fileout on a FAT32 filesystem  
on a Linux box, should put LF in the file not CRLF."

My proposed fix would have made line-endings system specific for Mac,  
but not for Linux.  Hard to test this one unless you have all the  
systems.  Please embellish my fix so that it is right for Linux, and  
add to the bug report.

> Reader should be prepared to handle any convention while writers  
> should be
> using platform-native convention for text files.

That is in fact what the code does.  For existing files, the CRLF  
code will detect what is there.  The CRLF platform-specific detection  
applies only to new files, and only to CRLF text files.

> Shouldn't this be handled in a primitive or a System Attribute?  
> Attempting to
> guess line ending in Squeak code sounds regressive.

I don't see why there is need for a primitive, when a couple of lines  
of Smalltalk can do the right thing easily enough.  The only problem  
seems to be getting these fixes into the release.   The bug database  
is in danger of becoming a black hole

	Andrew

On 7 May 2007, at 10:52, subbukk wrote:

> Hi,
>
> I bumped into CRLF pollution in SqueakV39.sources file and also saw  
> the bug
> report
> http://bugs.squeak.org/view.php?id=6173
> by Andrew.
>
> IMHO, line endings is platform-specific (not filesystem specific).  
> A fileout
> on a FAT32 filesystem on a Linux box, should put LF in the file not  
> CRLF.
>
> Reader should be prepared to handle any convention while writers  
> should be
> using platform-native convention for text files.
>
> Shouldn't this be handled in a primitive or a System Attribute?  
> Attempting to
> guess line ending in Squeak code sounds regressive.
>
> Regards .. Subbu
>

Andrew P. Black
Department of Computer Science
Portland State University
+1 503 725 2411



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070508/9feb1dbd/attachment.htm


More information about the Squeak-dev mailing list