History: restore it 37/16937/2
Calixte DENIZET [Thu, 30 Jul 2015 10:45:04 +0000 (12:45 +0200)]
Change-Id: I3c1412ff51a23e1f14f2110a99d02cf993695b37

scilab/modules/history_manager/src/cpp/HistoryFile.cpp

index 6be1700..3aa0851 100644 (file)
@@ -37,6 +37,7 @@ extern "C"
 #include "mclose.h"
 #include "freeArrayOfString.h"
 #include "os_wfopen.h"
+#include "expandPathVariable.h"
 };
 /*------------------------------------------------------------------------*/
 #define DEFAULT_HISTORY_FILE_MAX_LINES 20000
@@ -65,7 +66,10 @@ void HistoryFile::setFilename(std::string _stFilename)
 {
     if (_stFilename.empty() == false)
     {
-        m_stFilename = _stFilename;
+        // TODO: const_cast is very bad...
+        char * expanded = expandPathVariable((char *)(_stFilename.c_str()));
+        m_stFilename = std::string(expanded);
+        FREE(expanded);
     }
     else
     {