Skip to content
Snippets Groups Projects
Commit 91b82beb authored by Luigi Scarso's avatar Luigi Scarso
Browse files

better restore of old locale with copy --- trunk and tag 1.0.4

[[Split portion of a mixed commit.]]
parent 1c05d396
Branches
Tags
No related merge requests found
...@@ -933,7 +933,7 @@ void lua_initialize(int ac, char **av) ...@@ -933,7 +933,7 @@ void lua_initialize(int ac, char **av)
/* Get the current locale (it should be C ) */ /* Get the current locale (it should be C ) */
/* and save LC_CTYPE, LC_COLLATE and LC_NUMERIC. */ /* and save LC_CTYPE, LC_COLLATE and LC_NUMERIC. */
/* Later luainterpreter() will consciously use them. */ /* Later luainterpreter() will consciously use them. */
old_locale = setlocale (LC_ALL, NULL); old_locale = xstrdup(setlocale (LC_ALL, NULL));
lc_ctype = NULL; lc_ctype = NULL;
lc_collate = NULL; lc_collate = NULL;
lc_numeric = NULL; lc_numeric = NULL;
...@@ -965,6 +965,7 @@ void lua_initialize(int ac, char **av) ...@@ -965,6 +965,7 @@ void lua_initialize(int ac, char **av)
fprintf(stderr,"Unable to restore original locale:exit now.\n"); fprintf(stderr,"Unable to restore original locale:exit now.\n");
exit(1); exit(1);
} }
xfree(old_locale);
} else { } else {
fprintf(stderr,"Unable to store environment locale.\n"); fprintf(stderr,"Unable to store environment locale.\n");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment