fix browsevar manager update 12/16512/7
Anais AUBERT [Tue, 26 May 2015 14:51:07 +0000 (16:51 +0200)]
Change-Id: I706dbd4bf21180a758a7f8d961dd7957d2c1b3c5

scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/core/src/cpp/runner.cpp

index 74f6321..4608529 100644 (file)
@@ -522,22 +522,6 @@ void* scilabReadAndExecCommand(void* param)
 
         processCommand(_pSEI);
         FREE(command);
-
-        if (getScilabMode() != SCILAB_NWNI)
-        {
-
-            char *cwd = NULL;
-
-            int err = 0;
-
-            UpdateBrowseVar();
-            cwd = scigetcwd(&err);
-            if (cwd)
-            {
-                FileBrowserChDir(cwd);
-                FREE(cwd);
-            }
-        }
     }
 
     return NULL;
index 4a52ab5..c338e36 100644 (file)
 #include "threadmanagement.hxx"
 #include "configvariable.hxx"
 
+extern "C"
+{
+#include "BrowseVarManager.h"
+#include "FileBrowserChDir.h"
+#include "scicurdir.h"
+}
+
 using namespace ast;
 
 void *Runner::launch(void *args)
@@ -45,6 +52,20 @@ void *Runner::launch(void *args)
         ConfigVariable::resetWhereError();
     }
 
+    if (getScilabMode() != SCILAB_NWNI)
+    {
+        char *cwd = NULL;
+        int err = 0;
+
+        UpdateBrowseVar();
+        cwd = scigetcwd(&err);
+        if (cwd)
+        {
+            FileBrowserChDir(cwd);
+            FREE(cwd);
+        }
+    }
+
     // reset error state when new prompt occurs
     ConfigVariable::resetError();