Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2005, 11:05:01 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: a better check for the data-directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/util/resource_manager.cc

    r4223 r4295  
    8787bool ResourceManager::setDataDir(const char* dataDir)
    8888{
    89   if (isDir(dataDir))
     89  char* checkDir = ResourceManager::homeDirCheck(dataDir);
     90  if (isDir(checkDir))
    9091    {
    9192      delete this->dataDir;
    92       this->dataDir = new char[strlen(dataDir)+1];
    93       strcpy(this->dataDir, dataDir);
     93      this->dataDir = new char[strlen(checkDir)+1];
     94      strcpy(this->dataDir, checkDir);
     95      delete checkDir;
    9496      return true;
    9597    }
     
    9799    {
    98100      PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", dataDir, this->dataDir);
     101      delete checkDir;
    99102      return false;
    100103    }
Note: See TracChangeset for help on using the changeset viewer.