mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-12-24 14:54:52 +01:00
Unix basedir: Don't read past start of array if $PATH has an empty item.
This commit is contained in:
parent
91827e7d2a
commit
b42025bc9f
|
@ -106,6 +106,7 @@ static char *getUserDirByUID(void)
|
|||
}
|
||||
|
||||
// !!! FIXME: This could stand to use CTFileNames ...
|
||||
// !!! FIXME: When we move to SDL2, just use SDL_GetBasePath()?
|
||||
static char *calcExePath(const char *_argv0)
|
||||
{
|
||||
char *ptr;
|
||||
|
@ -137,6 +138,8 @@ static char *calcExePath(const char *_argv0)
|
|||
start = envr;
|
||||
do
|
||||
{
|
||||
while (*start == ':')
|
||||
start++; // skip empty entries.
|
||||
ptr = strchr(start, ':');
|
||||
if (ptr)
|
||||
*ptr = '\0';
|
||||
|
|
Loading…
Reference in New Issue
Block a user