Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #12 from frankshearar/master

Prevent trailing rubbish when source shrinks.
  • Loading branch information...
commit 079e6b2413d810fe2781da63e55cba9cf47a4f95 2 parents dbff962 + 44da211
@timfel authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  Core/
2  Core/
@@ -87,6 +87,8 @@ writeSourceCodeFrom: aStream to: aFile
ifTrue: [converter := MacRomanTextConverter new]
ifFalse: [converter := UTF8TextConverter new].
fileName := aFile, (FileDirectory dot, 'st').
+ "If the new version of the file is shorter than the current version, deleting the file means we won't leave trailing rubbish from the old version."
+ FileDirectory deleteFilePath: fileName.
f := MultiByteFileStream new open: fileName forWrite: true.
f ifNil: [^ self error: 'Cannot open file'].
f lineEndConvention: #lf.
Please sign in to comment.
Something went wrong with that request. Please try again.