|Anonymous | Login||07-12-2020 10:21 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ 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|
|Summary||0006173: Auto-detection of cr/lf is broken on MacOS X|
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.
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.
guessLineEndFix.1.cs [^] (1,332 bytes) 02-19-07 22:40
CrLfFileStream on MacOSX.txt [^] (15,136 bytes) 02-19-07 22:44
(0010000 - 274 - 274 - 274 - 274 - 274 - 274)
|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)
|Harvested in update 7117 and released in Squeak 3.10.|
|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.