mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Fix #2062 Be more diligent about validating trailing "/" existence in HOME and XDG_DATA_HOME env vars
This commit is contained in:
parent
58a558e326
commit
e5b65e4e03
@ -173,7 +173,15 @@ SDL_GetPrefPath(const char *org, const char *app)
|
|||||||
SDL_SetError("neither XDG_DATA_HOME nor HOME environment is set");
|
SDL_SetError("neither XDG_DATA_HOME nor HOME environment is set");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
append = ".local/share/";
|
if (envr[SDL_strlen(envr) - 1] == '/') {
|
||||||
|
append = ".local/share/";
|
||||||
|
} else {
|
||||||
|
append = "/.local/share/";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (envr[SDL_strlen(envr) - 1] == '/') {
|
||||||
|
append = "";
|
||||||
|
}
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
len = SDL_strlen(envr) + SDL_strlen(append) + SDL_strlen(app) + 2;
|
len = SDL_strlen(envr) + SDL_strlen(append) + SDL_strlen(app) + 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user