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
No related branches found
No related tags found
No related merge requests found
......@@ -933,7 +933,7 @@ void lua_initialize(int ac, char **av)
/* Get the current locale (it should be C ) */
/* and save LC_CTYPE, LC_COLLATE and LC_NUMERIC. */
/* Later luainterpreter() will consciously use them. */
old_locale = setlocale (LC_ALL, NULL);
old_locale = xstrdup(setlocale (LC_ALL, NULL));
lc_ctype = NULL;
lc_collate = NULL;
lc_numeric = NULL;
......@@ -965,6 +965,7 @@ void lua_initialize(int ac, char **av)
fprintf(stderr,"Unable to restore original locale:exit now.\n");
exit(1);
}
xfree(old_locale);
} else {
fprintf(stderr,"Unable to store environment locale.\n");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment