mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 18:30:27 +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: This could stand to use CTFileNames ...
|
||||||
|
// !!! FIXME: When we move to SDL2, just use SDL_GetBasePath()?
|
||||||
static char *calcExePath(const char *_argv0)
|
static char *calcExePath(const char *_argv0)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
@ -137,6 +138,8 @@ static char *calcExePath(const char *_argv0)
|
||||||
start = envr;
|
start = envr;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
while (*start == ':')
|
||||||
|
start++; // skip empty entries.
|
||||||
ptr = strchr(start, ':');
|
ptr = strchr(start, ':');
|
||||||
if (ptr)
|
if (ptr)
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user