We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2311

Summary: SDL_GetPrefPath broken, truncates path on Mac OS X.
Product: SDL Reporter: Brad Smith <rainwarrior+libsdl>
Component: fileAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P1 CC: gindar, mike, rainwarrior+libsdl
Version: 2.0.1   
Hardware: All   
OS: Mac OS X (All)   

Description Brad Smith 2013-12-17 10:45:21 UTC
SDL_sysfilesystem.m at line 72 note that the calculated value "len" does not include room for the "org" string. The resulting path is truncated by the number of characters in the org string.
Comment 1 Sam Lantinga 2014-02-13 05:17:28 UTC
Ryan, can you look at this for the 2.0.2 release?

Thanks!
Comment 2 Michael Labbé 2014-02-28 01:06:20 UTC
I stumbled on this bug and fixed it locally.  Here is the fixed line:

            const size_t len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4;
Comment 3 Sam Lantinga 2014-03-01 18:29:08 UTC
Ryan, it looks like you fixed this in this changeset:
https://hg.libsdl.org/SDL/rev/b34f5e226458
Comment 4 Ryan C. Gordon 2014-03-02 01:30:15 UTC
(In reply to Sam Lantinga from comment #3)
> Ryan, it looks like you fixed this in this changeset:
> https://hg.libsdl.org/SDL/rev/b34f5e226458

So I did!   :)

--ryan.