diff --git a/src/gfx_curses.c b/src/gfx_curses.c index 649f206..5b7dd3c 100644 --- a/src/gfx_curses.c +++ b/src/gfx_curses.c @@ -3,7 +3,7 @@ #include #include "gfx.h" #include "merge.h" -#include +#include #include #define NUMBER_OF_COLORS 7 diff --git a/src/main.c b/src/main.c index d888c5a..51cf663 100644 --- a/src/main.c +++ b/src/main.c @@ -14,10 +14,23 @@ void draw_then_sleep(struct gfx_state *s, struct gamestate *g) gfx_sleep(160 / g->opts->grid_width); } +char *targetDir(char *env, char *path) +{ + char *dir; + char *dirEnv; + dirEnv = getenv(env); + dir = malloc(strlen(dirEnv) + strlen(path) + 1); + strcpy(dir, dirEnv); + strcat(dir,path); + return dir; +} + int main(int argc, char **argv) { + + setlocale (LC_ALL, ""); - bindtextdomain ("gfx_terminal", strcat(getenv("PWD"),"/18n/")); + bindtextdomain ("gfx_terminal", targetDir("PWD","/18n/")); textdomain ("gfx_terminal"); struct gamestate *g = gamestate_init(argc, argv);