help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] DLD Safety patch


From: Simon Britnell
Subject: [Help-smalltalk] DLD Safety patch
Date: Fri, 27 Apr 2001 16:09:58 -0700 (PDT)

Here's a patch which ensures that each library and
module is included in the DLD lists only once. 
Hopefully yahoo won't do anything evil with line
wrapping.

--- orig/smalltalk-1.95.4/kernel/DLD.st Fri Mar  2
02:53:47 2001
+++ smalltalk-1.95.4/kernel/DLD.st      Sat Apr 28 10:57:11
2001
@@ -175,8 +175,9 @@
 !
 
 addLibrary: library
-    "Add library to the search path of libraries to
be used by DLD"
-    LibraryList add: library -> nil
+    "Add library to the search path of libraries to
be used by DLD."
+    ( LibraryList contains: [ :anAssociation |
anAssociation key = library ] )
+       ifFalse: [ LibraryList add: library -> nil ]
 !
 
 addModule: library
@@ -185,9 +186,11 @@
      but the library will not be put in the search
path used whenever
      a C function is requested but not registered."
 
-    (self linkFile: library) isNil
-       ifTrue: [ self error: 'requested module ', library,
' was not found' ]
-       ifFalse: [ ModuleList add: library ]
+    ( ModuleList includes: library ) ifFalse: [
+        (self linkFile: library) isNil
+           ifTrue: [ self error: 'requested module ',
library, ' was not found' ]
+           ifFalse: [ ModuleList add: library ]
+    ]
 ! !
 
 DLD initialize!


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]