Should return something like "/Users/me/Library/Application Support" and allow the application to launch correctly
Actual Behavior
libc++abi: terminating due to uncaught exception of type std::__1::__fs::filesystem::filesystem_error: filesystem error: in directory_iterator::directory_iterator(...): No such file or directory ["/RSDKv3"] thrown in ResolvePath
Steps to Reproduce
Follow the instructions linked in the Readme to setup the Xcode project.
Build with Xcode 14.3.1 and Run
Have strings like modsPath set to "/RSDKv3" and crash
The documentation for NSString remarks that the string pointed at by UTF8String is unreliable past NSString's lifetime, on my machine the returned string gets clobbered to '\0' immediately hence the above behaviour. The C string should really be copied to a buffer before being returned.
I modified the function to return std::string instead and it works correctly but I'm holding off making a PR in case the project would prefer a different approach.
Expected Behavior
Should return something like "/Users/me/Library/Application Support" and allow the application to launch correctly
Actual Behavior
libc++abi: terminating due to uncaught exception of type std::__1::__fs::filesystem::filesystem_error: filesystem error: in directory_iterator::directory_iterator(...): No such file or directory ["/RSDKv3"]
thrown in ResolvePathSteps to Reproduce
modsPath
set to "/RSDKv3" and crashScreenshots
No response
Log File
No response
Decompilation Version
master (01babfc)
Game Version
Blit Release (Steam/XBOX 360/PS3)
Game Revision
No response
Script Platform Type
Standard
Renderer Type
Software Renderer
Platform
MacOS Ventura 13.4.1
Additional Comments
https://github.com/Rubberduckycooly/Sonic-CD-11-Decompilation/blob/01babfce7e9fc58960960012f03ad7a0aad6499c/dependencies/mac/cocoaHelpers.mm#L13
The documentation for NSString remarks that the string pointed at by UTF8String is unreliable past NSString's lifetime, on my machine the returned string gets clobbered to '\0' immediately hence the above behaviour. The C string should really be copied to a buffer before being returned.
I modified the function to return std::string instead and it works correctly but I'm holding off making a PR in case the project would prefer a different approach.