Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/al_env.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ -d "${CMAKE_INSTALL_PREFIX}/lib/python${PYVER}/site-packages" ]; then
export PYTHONPATH="${CMAKE_INSTALL_PREFIX}/lib/python${PYVER}/site-packages:$PYTHONPATH"
fi
if [ -d "${CMAKE_INSTALL_PREFIX}/models/mdsplus" ]; then
export ids_path="${CMAKE_INSTALL_PREFIX}/models/mdsplus"
export MDSPLUS_MODEL_PATH="${CMAKE_INSTALL_PREFIX}/models/mdsplus"
fi
if [ -f "${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml" ]; then
export IDSDEF_PATH="${CMAKE_INSTALL_PREFIX}/include/IDSDef.xml"
Expand Down
18 changes: 10 additions & 8 deletions src/mdsplus/mdsplus_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ static char *getPathInfo(MDSplus::Data *data, MDSplus::TreeNode *refNode)
std::string translatedBaseStr(translatedBase);
if(originalIdsPath == "")
{
char *origPath = getenv(szPath);
char *origPath = getenv("MDSPLUS_MODEL_PATH");
if(origPath)
originalIdsPath = origPath;
}
Expand All @@ -1440,10 +1440,11 @@ static char *getPathInfo(MDSplus::Data *data, MDSplus::TreeNode *refNode)
}
#ifdef WIN32
char szEnv[256] = { 0 };
sprintf(szEnv, "%s=%s", szPath, translatedBaseStr.c_str());
//sprintf(szEnv, "%s=%s", szPath, translatedBaseStr.c_str());
sprintf(szEnv, "%s=%s", "MDSPLUS_MODEL_PATH", translatedBaseStr.c_str());
putenv(szEnv);
#else // WIN32
setenv(szPath, translatedBaseStr.c_str(), 1);
setenv("MDSPLUS_MODEL_PATH", translatedBaseStr.c_str(), 1);
#endif // WIN32
}
}
Expand All @@ -1469,10 +1470,11 @@ void MDSplusBackend::resetIdsPath(std::string strTree) {

#ifdef WIN32
char szEnv[256] = { 0 };
sprintf(szEnv, "%s=%s", szPath, originalIdsPath.c_str());
//sprintf(szEnv, "%s=%s", szPath, originalIdsPath.c_str());
sprintf(szEnv, "%s=%s", "MDSPLUS_MODEL_PATH", originalIdsPath.c_str());
putenv(szEnv);
#else // WIN32
setenv(szPath, originalIdsPath.c_str(), 1);
setenv("MDSPLUS_MODEL_PATH", originalIdsPath.c_str(), 1);
#endif // WIN32

// Reset the global variable originalIdsPath to an empty string so
Expand All @@ -1495,7 +1497,7 @@ void MDSplusBackend::resetIdsPath(std::string strTree) {

if(originalIdsPath == "") //Do it only once in case it is defined
{
char *origPath = getenv(szPath);
char *origPath = getenv("MDSPLUS_MODEL_PATH");
if(origPath)
originalIdsPath = origPath;
}
Expand All @@ -1508,11 +1510,11 @@ void MDSplusBackend::resetIdsPath(std::string strTree) {
#ifdef WIN32
char szEnv[256] = { 0 };
// sprintf(szEnv, "%s=%s", szPath, mdsplusBaseStr.c_str());
sprintf(szEnv, "%s=%s", szPath, newPathStr.c_str());
sprintf(szEnv, "%s=%s", "MDSPLUS_MODEL_PATH", newPathStr.c_str());
putenv(szEnv);
#else // WIN32
// setenv(szPath, mdsplusBaseStr.c_str(), 1);
setenv(szPath, newPathStr.c_str(), 1);
setenv("MDSPLUS_MODEL_PATH", newPathStr.c_str(), 1);
#endif // WIN32
}

Expand Down
Loading