Closed zeux closed 3 years ago
Thanks! Would you believe the existence of strrchr
has somehow passed me by for 30 odd years?!
:) I tried to use string_find_last but it required 4 variables which made the code a bit longer / harder to follow so I decided to use strrchr
since it didn't look like there's just a blanket ban on "str*" functions in this code, and I guess it worked out. Thanks for merging!
On Windows, paths with mixed slashes weren't processed correctly as \ would be picked if it was anywhere in the path for the purpose of determining base.
This also removes the #ifdef _WIN32 from the logic; this helps on platforms like Emscripten where running the resulting binary that wasn't compiled with WIN32 still needs backslash processing; paths with backslashes on Linux should be exceedingly rare, plus we already correct backslashes with forward slashes on Linux anyway...