Ticket #53: configdir.patch

File configdir.patch, 1.2 kB (added by mdmkolbe, 2 years ago)

CS_CONFIGDIR part of the Patch

  • libs/csutil/win32/instpath.cpp

     
    263263  // 1. CRYSTAL environment variable 
    264264  // 2. this machine's system registry 
    265265  // 3. if current working directory contains 'vfs.cfg' use this dir. 
    266   // 4. The dir where the app is 
    267   // 5. A "CrystalSpace" subfolder under the "Program Files" dir. 
    268   // 6. hard-wired default path 
     266  // 4. CS_CONFIGPATH if defined and on Cygwin 
     267  // 5. The dir where the app is 
     268  // 6. A "CrystalSpace" subfolder under the "Program Files" dir. 
     269  // 7. hard-wired default path 
    269270 
    270271  // try env variable first 
    271272  // we check this before we check registry, so that one app can putenv() to 
     
    297297 
    298298  // No luck to fetch a config setting. Add in order: 
    299299  // - current directory 
     300  // - CS_CONFIGDIR if defined and on Cygwin 
    300301  // - application directory 
    301302  // - %ProgramFiles%\CrystalSpace 
    302303  // - C:\Program Files\CrystalSpace 
    303304 
    304305  paths->AddUniqueExpanded ("."); 
     306#ifdef __CYGWIN__ 
     307#ifdef CS_CONFIGDIR 
     308  paths->AddUniqueExpanded (CS_CONFIGDIR); 
     309#endif 
     310#endif 
    305311 
    306312  { 
    307313    char apppath[MAX_PATH + 1];