Xcos: fix loadXcosLibs (again) after a43c4fbb51 54/18754/1
Clément DAVID [Mon, 5 Dec 2016 13:28:41 +0000 (14:28 +0100)]
Change-Id: If370189d8babaa7f0ff1491f86ee5550676a4ff8

scilab/modules/xcos/macros/loadXcosLibs.sci

index 499bd64..3d678e0 100644 (file)
@@ -16,6 +16,7 @@
 function loadXcosLibs()
     // Extracted from initial_scicos_tables
     scicos_pal_libs = ["Branching","Events","Misc","Sinks","Threshold","Linear","MatrixOp","NonLinear","Sources","Electrical","Hydraulics","PDE","IntegerOp"];
+    scicos_libs = ["scicos_scicos","scicos_utils","scicos_auto"];
 
     // list of scicos libraries that we need at xcos launch
     listlibsname = [];
@@ -26,11 +27,12 @@ function loadXcosLibs()
             listlibsname = [listlibsname, theLib];
         end
     end
-    clear theLib;
 
-    if isfile("SCI/modules/scicos/macros/scicos_scicos/lib") then
-        load("SCI/modules/scicos/macros/scicos_scicos/lib");
-        listlibsname = [listlibsname, "scicos_scicos", "scicos_utils", "scicos_auto"];
+    for theLib = scicos_libs
+        if isfile("SCI/modules/scicos/macros/" + theLib + "/lib") then
+            load("SCI/modules/scicos/macros/" + theLib + "/lib");
+            listlibsname = [listlibsname, theLib];
+        end
     end
 
     // name and libname