Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5755: Fix symlink handling of `fs_listdir` r=def- a=Robyt3 On Windows, the check was incorrectly using logical or instead of bitwise or. Checking for the flag `FILE_ATTRIBUTE_REPARSE_POINT` is not necessary, as the `FILE_ATTRIBUTE_DIRECTORY` will correctly be set when the target of a symbolic link is a directory. This otherwise causes symbolic links to files to be incorrectly handled as directories. On Linux, the minor performance optimization of using `entry->d_type` is reverted and `fs_is_dir` is used instead. This internally uses `stat`, which correctly returns the attributes for the symbolic link targets. Closes ddnet#5752. Closes ddnet#5753. ## Checklist - [X] Tested the change ingame (only on Windows) - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Robert Müller <[email protected]>
- Loading branch information