Fix the '~/dir/name' resolution fow windows
authorStefan Vogel <sv@exept.de>
Thu, 19 Jul 2012 16:42:30 +0200
changeset 14221 d2ef1c042257
parent 14220 2a3457b016be
child 14222 876ba773f5d2
Fix the '~/dir/name' resolution fow windows Store '~/' filenames in nameString - resolve if used.
UnixFilename.st
--- a/UnixFilename.st	Thu Jul 19 16:42:26 2012 +0200
+++ b/UnixFilename.st	Thu Jul 19 16:42:30 2012 +0200
@@ -187,9 +187,8 @@
 
 !UnixFilename methodsFor:'special accessing'!
 
-osNameForDirectory
-    "internal - return the OS's name for the receiver to
-     access it as a directory."
+osName
+    "redefined from superclass, because we do not distinguish file and directory names"
 
     ^ self osNameForFile
 !
@@ -198,18 +197,26 @@
     "internal - return the OS's name for the receiver to
      access it as a file."
 
-    nameString bitsPerCharacter < 8 ifTrue:[
-        ^ nameString.
+    |name|
+
+    (nameString startsWith:'~') ifTrue:[
+        name := self class nameWithSpecialExpansions:nameString. 
+    ] ifFalse:[
+        name := nameString.
     ].
-    ^ nameString utf8Encoded.
+
+    name bitsPerCharacter < 8 ifTrue:[
+        ^ name.
+    ].
+    ^ name utf8Encoded.
 ! !
 
 !UnixFilename class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixFilename.st,v 1.16 2009-10-28 14:02:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixFilename.st,v 1.17 2012-07-19 14:42:30 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixFilename.st,v 1.16 2009-10-28 14:02:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixFilename.st,v 1.17 2012-07-19 14:42:30 stefan Exp $'
 ! !