-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getUserDirectory: return libretro Save Directory instead of $USER env
- Fixes a mem corruption bug: adding a trailing slash was corrupting the env table of the process - converted implementation to use `lual_dostring` thus performing non-trivial string operations within the safe GC'd confines of Lua getUserDirectory returns nil if the libretro frontend doesn't support it. This is done rather than using a substitution because there is no suitable substitution that is guaranteed to be writable. It's better to fail on returning a valid path than to fail in unexpected ways later on when trying to write data to the directory. The love/lutro game app will need to check for hand handle such cases appropriately if it wants to be well-behaved running under libretro. It occurs to me that it could be swell if there was an IDE and/or C preprocessor that allowed embedding lua into C code. Something similar perhaps to how one can embed PHP code inside HTML, as an example.
- Loading branch information
Showing
3 changed files
with
82 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters