Mantis Bugtracker

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006173 [Squeak] Files major always 02-19-07 22:39 11-18-08 20:25
Reporter black View Status public  
Assigned To cdegroot
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.10 Product Version 3.9
  Product Build
Summary 0006173: Auto-detection of cr/lf is broken on MacOS X
Description Whenever an image is restarted, CrLfFileStream class >> startUp invokes CrLfFileStream class >> guessDefaultLineEndConvention to reset the class variable LineEndDefault to one of #cr, #lf or #crlf.
This variable is used to determine the cr translation to be used. The same logic has been copied into MultiByteFileStream.

The guessDefaultLineEndConvention uses the pathNameDelimiter of the deafult directory class to figure out which file system we are running on. This used to be correct, because Mac VMs ran on Mac file systems. But it is no longer correct: the right file directory on MacOSX is UnixFileDirectory, so this no longer suffices to distinguish Mac from ordinary Unix.
Steps To Reproduce
Additional Information I propose a fix in the attached changeset which makes the guessDefaultLineEndConvention look and see if the underlying platform is darwin (Mac OS's Unix), and if so choose #cr as the default line ending. The change is copied to both CrLfFileStream class >> guessDefaultLineEndConvention and MultiByteFileStream >> guessDefaultLineEndConvention.

You might think that this code should go in a trait, so that it coulbe be sahred between the two classes. Or that MultiByteFileStream should subclass CrLfFileStream. But, in fact, CrLfFileStream is dead: its new method creates a MultiByteFileStream. So all of its methods except for CrLfFileStream new could be deleted. (Or, MultiByteFileStream could subclass CrLfFileStream, use basicNew, and all of its methods that replicate the superclass could be deleted.) Right now, however, I'm more concerned with getting the bug fixed than with getting the code cleaned up.
Attached Files  guessLineEndFix.1.cs [^] (1,332 bytes) 02-19-07 22:40
 CrLfFileStream on MacOSX.txt [^] (15,136 bytes) 02-19-07 22:44

- Relationships

- Notes
(0010000 - 274 - 274 - 274 - 274 - 274 - 274)
02-19-07 22:49

I've also attached an archive of the discussion on Squeak-dev on this topic. What I learned from this is that John McIntosh believs that the MacFileDirectory classes are now for Mac OS 9 and earlier only , and that UnixFileDirectory is the right choice for MacOS X systems.
(0012782 - 53 - 53 - 53 - 53 - 53 - 53)
11-18-08 20:25

Harvested in update 7117 and released in Squeak 3.10.

- Issue History
Date Modified Username Field Change
02-19-07 22:39 black New Issue
02-19-07 22:39 black Status new => assigned
02-19-07 22:39 black Assigned To  => cdegroot
02-19-07 22:40 black File Added: guessLineEndFix.1.cs
02-19-07 22:41 black Issue Monitored: black
02-19-07 22:44 black File Added: CrLfFileStream on MacOSX.txt
02-19-07 22:49 black Note Added: 0010000
11-18-08 20:25 KenCausey Status assigned => closed
11-18-08 20:25 KenCausey Note Added: 0012782
11-18-08 20:25 KenCausey Resolution open => fixed
11-18-08 20:25 KenCausey Fixed in Version  => 3.10

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
48 total queries executed.
34 unique queries executed.
Powered by Mantis Bugtracker