Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linux auto rom detection for built-in extractor #842

Merged

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Nov 12, 2024

Linux has special handling for directory searching that relies on stat. The issue was that the item names returned by dirent were just the name of the file itself, not a real path. So stat was always returning an error when trying to search for rom flies. This would lead to "No roms found" modal even if there was a rom file next to the .appimage.

This fixes it by building a real path using the passed in search path before querying stat and appending the path to the roms list.

I'm not entirely sure why we search directories differently for each platform, as the else case uses std::filesystem::directory_iterator which was standardized in C++17, so a future improvement would be to drop the platform handling for the simple case.

Build Artifacts

@Archez Archez merged commit 3168555 into HarbourMasters:develop-satoko Nov 12, 2024
5 checks passed
@Archez Archez deleted the fix-linux-rom-detection branch November 12, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants