Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8271 for code/branches


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

Fixed PATH fiddling for module/plugin loading.

Location:
code/branches/kicklib/src/libraries/core
Files:
3 edited

Legend:

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

    r8231 r8271  
    247247#endif
    248248
     249#ifdef ORXONOX_PLATFORM_WINDOWS
    249250        // Add OGRE plugin path to the environment. That way one plugin could
    250251        // also depend on another without problems on Windows
    251         std::string pathVariable(getenv("PATH"));
    252         putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + pluginPath).c_str()));
     252        const char* currentPATH = getenv("PATH");
     253        std::string newPATH = pluginPath;
     254        if (currentPATH != NULL)
     255            newPATH = std::string(currentPATH) + ';' + newPATH;
     256        putenv(const_cast<char*>(("PATH=" + newPATH).c_str()));
     257#endif
    253258
    254259        // Do some SubString magic to get the comma separated list of plugins
  • 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
  • code/branches/kicklib/src/libraries/core/PathConfig.h

    r7427 r8271  
    113113            static std::string getModulePathString();
    114114
    115             //! Return trrue for runs in the build directory (not installed)
     115            //! Return true for runs in the build directory (not installed)
    116116            static bool isDevelopmentRun() { return getInstance().bDevRun_; }
    117117
Note: See TracChangeset for help on using the changeset viewer.