Skip to content

Fix addon loading issues with symlinks on Linux/*BSD

Hanicef requested to merge Hanicef/SRB2:fix-broken-symlink-reading into next

Due to double work caused by !1976 (merged) and !2198 (merged) combined, Linux and *BSD failed to follow symlinks properly, which caused numerous issues with loading addons. What was essentially happening was that since !2198 (merged) used the underlying d_type field to determine it's type, it explicitly wasn't respecting symlinks when traversing the tree. However, when !1976 (merged) was merged, additional logic was added to expand symlink paths to it's full path, which sometimes caused SRB2 to treat files by their wrong type as the file tree type wouldn't match the underlying file type.

This patch handles this properly by explicitly inspecting symlinks while traversing the tree. This way, symlinks to directories will be traversed properly and underlying file types will be properly expanded.

Merge request reports