segsegv with NULL lang
This commit is contained in:
parent
cdd13c51cd
commit
ce58f7e5a1
|
@ -14,8 +14,8 @@ LUA_LFLAGS=$(shell pkg-config --libs lua5.1)
|
||||||
|
|
||||||
# for arch linux (may be others) use this
|
# for arch linux (may be others) use this
|
||||||
#
|
#
|
||||||
# LUA_CFLAGS=$(shell pkg-config --cflags lua)
|
LUA_CFLAGS=$(shell pkg-config --cflags lua)
|
||||||
# LUA_LFLAGS=$(shell pkg-config --libs lua)
|
LUA_LFLAGS=$(shell pkg-config --libs lua)
|
||||||
#
|
#
|
||||||
|
|
||||||
SDL_CFLAGS=$(shell sdl-config --cflags)
|
SDL_CFLAGS=$(shell sdl-config --cflags)
|
||||||
|
|
|
@ -28,8 +28,9 @@ void nsleep(int u)
|
||||||
char *game_locale(void)
|
char *game_locale(void)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
char *s = strdup(getenv("LANG"));
|
char *s;
|
||||||
if (!s)
|
p = getenv("LANG");
|
||||||
|
if (!p || !(s = strdup(p)))
|
||||||
return NULL;
|
return NULL;
|
||||||
if ((p = strchr(s, '_')))
|
if ((p = strchr(s, '_')))
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
Reference in a new issue