Source Code Project Mantis - FSSCP
View Issue Details
0003036FSSCPPlatform-Engine interactionpublic2014-04-30 00:302015-01-22 14:29
Assigned Tochief1983 
PlatformOSLinuxOS Version
Product Version3.7.1 
Target Version3.7.2Fixed in Version3.7.2 RC5 
Summary0003036: cf_exists does not search all dirs correctly on Linux (and probably OSX)
DescriptionPretty much as it says. On Linux/OSX, some "directories" have two locations.


cf_exists will only find files in the 2nd location, even though valid files may be in the 1st location. It should probably search both locations, with the 2nd one having precedence.

Definitely affects CF_TYPE_CONFIG, may affect other types as well.


Note: cf_exists_full correctly (?? maybe, haven't checked precedence) finds files in both locations.
Steps To ReproduceSee attached mod.

Press enter in the mainhall (or anywhere) to run a script that attempts to open test files in nearly all known locations.
Failure to open the file generates a warning.
Switch the cf.fileExists() 3rd param to true and all files will be found.
Add the relevant files to the relevant directories in ~/.fs_open/ and the files will be found.
Additional InformationFound when using LUA cf.fileExists() with the 3rd param set to false. Note that setting the 3rd param to true is a workaround.
TagsNo tags attached.
Attached Files7z mantis3036_mod.7z (1,193) 2014-05-08 23:46
diff 3036_proposed.diff (1,105) 2015-01-18 22:34

2015-01-18 22:35   
I've attached a patch which should fix this issue, by causing this function to use the same lower level function as the other cf_exists* family of functions. This should simplify the code as a result, if there are no adverse effects from this behavior change. Since the behavioral difference appears to have been platform-specific, I don't anticipate issues.
2015-01-18 22:40   
Update the steps to reproduce with what I believe is a typo fix since cf_exists doesn't have 3 arguments but the referenced Lua counterpart does.
2015-01-18 22:41   
Patch doesn't seem to cause any issues for me on Windows with the MediaVPs and my recent trunk build, will test OS X tomorrow. Would like to hear results of general purpose gameplay testing and the mod test from a Linux user before I commit.
2015-01-20 04:22   
Works fine on Linux both playing a mission with mediavps_2014 & running the attached test mod.
2015-01-22 14:21   
Fix committed to trunk@11222.

Issue History
2014-04-30 00:30niffiwanNew Issue
2014-04-30 02:00niffiwanDescription Updatedbug_revision_view_page.php?rev_id=787#r787
2014-04-30 02:00niffiwanAdditional Information Updatedbug_revision_view_page.php?rev_id=789#r789
2014-05-08 23:46niffiwanFile Added: mantis3036_mod.7z
2014-05-08 23:49niffiwanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=795#r795
2015-01-18 22:33chief1983Assigned To => chief1983
2015-01-18 22:33chief1983Statusnew => assigned
2015-01-18 22:34chief1983File Added: 3036_proposed.diff
2015-01-18 22:35chief1983Note Added: 0016455
2015-01-18 22:36chief1983Statusassigned => code review
2015-01-18 22:40chief1983Note Added: 0016456
2015-01-18 22:40chief1983Steps to Reproduce Updatedbug_revision_view_page.php?rev_id=971#r971
2015-01-18 22:41chief1983Note Added: 0016457
2015-01-20 04:22niffiwanNote Added: 0016458
2015-01-22 14:21chief1983Changeset attached => fs2open trunk r11222
2015-01-22 14:21chief1983Note Added: 0016459
2015-01-22 14:21chief1983Statuscode review => resolved
2015-01-22 14:21chief1983Resolutionopen => fixed
2015-01-22 14:29chief1983Fixed in Version => 3.7.2 RC5
2015-01-22 14:29chief1983Target Version => 3.7.2