Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 20, 2011, 12:10:36 AM (13 years ago)
Author:
rgrieder
Message:

Fixed PATH fiddling for module/plugin loading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/src/libraries/core/PathConfig.cc

    r8225 r8271  
    260260        size_t moduleextensionlength = moduleextension.size();
    261261
     262#ifdef ORXONOX_PLATFORM_WINDOWS
    262263        // Add that path to the PATH variable in case a module depends on another one
    263         std::string pathVariable(getenv("PATH"));
    264         putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + modulePath_.BF_NATIVE_STRING()).c_str()));
     264        const char* currentPATH = getenv("PATH");
     265        std::string newPATH = modulePath_.BF_NATIVE_STRING();
     266        if (currentPATH != NULL)
     267            newPATH = std::string(currentPATH) + ';' + newPATH;
     268        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
     269#endif
    265270
    266271        // Make sure the path exists, otherwise don't load modules
Note: See TracChangeset for help on using the changeset viewer.