Avoid reading rc.d files twice jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sun, 01 May 2016 22:24:22 +0200
branchjv
changeset 1431 691727155921
parent 1429 826faceb60a5
child 1432 1e235b190ee3
Avoid reading rc.d files twice if the directory happends to appear twice in a system path. This may happen, for example when Smalltalk/X is launched from build tree.
smalltalk.rc
--- a/smalltalk.rc	Fri Apr 01 06:37:53 2016 +0200
+++ b/smalltalk.rc	Sun May 01 22:24:22 2016 +0200
@@ -628,7 +628,14 @@
     rcD := syspath asFilename / 'rc.d'.
     rcD exists ifTrue:[
 	rcD directoryContentsAsFilenames do:[:each|
-	    each suffix = 'rc' ifTrue:[ rcDFiles add: each]
+	    each suffix = 'rc' ifTrue:[
+	        | eachAbs |
+
+	        eachAbs := each asAbsoluteFilename.
+	        (rcDFiles includes: eachAbs) ifFalse:[
+	    	    rcDFiles add: eachAbs.
+	    	]
+	    ]
 	].
     ].
 ].