UFO: Alien Invasion Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
OPEN  Bug report #2830  -  uforadiant app_path always set to current_dir
Posted Mar 17, 2011 - updated Jan 28, 2013
mattn (tlh2000) has been working on this issue since January 28, 2013 (20:47)
Issue details
  • Type of issue
    Bug report
  • Status
     
    Open
  • Assigned to
     mattn
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     kavol
  • Owned by
    Not owned by anyone
  • Estimated time
    Not estimated
  • Category
    Map Editor (UFORadiant)
  • Resolution
    Not determined
  • Priority
    3. Normal
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Targetted for
    icon_milestones.png Not determined
  • Complexity
    icon_customdatatype.png Not determined
  • Platform
    icon_customdatatype.png Not determined
  • Architecture
    icon_customdatatype.png Not determined
Issue description
Item 2830 imported from sourceforge.net tracker on 2013-01-28 19:50:51

1) ufoai-2.3.1-source.tar.bz2

2) Fedora 14

3) run uforadiant from a directory different than the one that contains its files

looking at the problem in gdb:

Breakpoint 1, environment_init () at src/tools/radiant/radiant/environment.cpp:56 56 StringOutputStream path(256); (gdb) until 60 path << DirectoryCleaned(g_get_home_dir()) << RADIANT_HOME << RADIANT_DIRECTORY; (gdb) until 62 g_mkdir_with_parents(path.c_str(), 0775); (gdb) until 63 home_path = path.c_str(); (gdb) until 65 path.clear(); (gdb) until 67 const char *appPath = PKGDATADIR"/"RADIANT_DIRECTORY; (gdb) until 68 if (g_file_test(appPath, (GFileTest)G_FILE_TEST_IS_DIR) && g_path_is_absolute(path.c_str())) { (gdb) print path.c_str() $6 = 0x31e9a00 "" (gdb) print appPath $7 = 0x968501 "/usr/share/ufoai/radiant/"

/usr/share/ufoai/radiant/ is a dir, but the second part g_path_is_absolute(path.c_str()) is always false when there is path.clear(); just above the test

the following patch seems to fix the issue for me:

--- src/tools/radiant/radiant/environment.cpp~ 2010-11-29 17:46:35.000000000 +0100 +++ src/tools/radiant/radiant/environment.cpp 2011-03-17 14:25:06.819424023 +0100 @@ -65,7 +65,7 @@
        path.clear();
 #ifdef PKGDATADIR
        const char *appPath = PKGDATADIR"/"RADIANT_DIRECTORY;
- if (g_file_test(appPath, (GFileTest)G_FILE_TEST_IS_DIR) && g_path_is_absolute(path.c_str())) { + if (g_file_test(appPath, (GFileTest)G_FILE_TEST_IS_DIR)) {
                app_path = PKGDATADIR"/"RADIANT_DIRECTORY;
        } else
 #endif


Steps to reproduce this issue
Nothing entered.