gettext.h added - gettenv overwrite fixed.
This commit is contained in:
parent
70897bc9db
commit
6ad9b16454
|
@ -3,7 +3,7 @@
|
|||
#include <unistd.h>
|
||||
#include "gfx.h"
|
||||
#include "merge.h"
|
||||
#include <libintl.h>
|
||||
#include <gettext.h>
|
||||
#include <locale.h>
|
||||
|
||||
#define NUMBER_OF_COLORS 7
|
||||
|
|
15
src/main.c
15
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user