diff options
Diffstat (limited to 'moses/src/StaticData.cpp')
-rw-r--r-- | moses/src/StaticData.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp index 07a8005f7..48eef17b4 100644 --- a/moses/src/StaticData.cpp +++ b/moses/src/StaticData.cpp @@ -20,9 +20,6 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ -#include <boost/filesystem/operations.hpp> -#include <boost/filesystem/path.hpp> - #include <string> #include "util/check.hh" #include "PhraseDictionaryMemory.h" @@ -1365,16 +1362,24 @@ void StaticData::ClearTransOptionCache() const { void StaticData::SetExecPath(const std::string &path) { - namespace fs = boost::filesystem; - - fs::path full_path( fs::initial_path<fs::path>() ); + /* + namespace fs = boost::filesystem; + + fs::path full_path( fs::initial_path<fs::path>() ); + + full_path = fs::system_complete( fs::path( path ) ); + + //Without file name + m_binPath = full_path.parent_path().string(); + */ - full_path = fs::system_complete( fs::path( path ) ); - - //Without file name - m_binPath = full_path.parent_path().string(); + // NOT TESTED + size_t pos = path.rfind("/"); + if (pos != string::npos) + { + m_binPath = path.substr(0, pos); + } cerr << m_binPath << endl; - } const string &StaticData::GetBinDirectory() const |