You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.1 Reported for operating system, platform: Linux, All
Comments on the original bug report:
On 2013-08-24 12:11:00 +0000, wrote:
Created attachment 1305
Patch
Under UNIX, SDL_GetPrefPath() will construct a path like '$HOME/.local/share/app'. The current code, however, in unix/SDL_sysfilesystem.c makes a huge (and unsafe) assumption that $HOME or $XDG_DATA_HOME contain a slash '/' in the end.
That is not the case for some systems, where $HOME might be '/home/username'. The code right now looks like this:
const char envr = SDL_getenv("XDG_DATA_HOME");
if (!envr) {
/ You end up with "$HOME/.local/share/Game Name 2" /
envr = SDL_getenv("HOME");
if (!envr) {
/ we could take heroic measures with /etc/passwd, but oh well. /
SDL_SetError("neither XDG_DATA_HOME nor HOME environment is set");
return NULL;
}
} / if */
append = ".local/share/";
But in case 'envr' does not end in '/', then we might get a path like '/home/username.local/share/appname' instead.
Attached is a patch dealing with the issue. I tested it on my machine and it works fine. Unless some serious problem pops up with this patch, I believe it should be added.
On 2013-08-24 13:00:05 +0000, Edward Rudd wrote:
I would actually say it's the case for MOST systems that those variables do not have a trailing "/"..
On 2013-08-24 13:08:35 +0000, Edward Rudd wrote:
Thanks for the report and patch. the fix up there is mostly the same except I also did a check for a "/" on XDG_DATA_HOME so we don't end up with 2 "/"'s
On 2013-08-24 13:50:39 +0000, wrote:
(In reply to Edward Rudd from comment # 2)
Thanks for the report and patch. the fix up there is mostly the same except
I also did a check for a "/" on XDG_DATA_HOME so we don't end up with 2 "/"'s
Great, thanks for fixing!
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.1
Reported for operating system, platform: Linux, All
Comments on the original bug report:
On 2013-08-24 12:11:00 +0000, wrote:
On 2013-08-24 13:00:05 +0000, Edward Rudd wrote:
On 2013-08-24 13:08:35 +0000, Edward Rudd wrote:
On 2013-08-24 13:50:39 +0000, wrote:
The text was updated successfully, but these errors were encountered: