From 9b14cb6b12e6f1b07a1ad401e5cb6e091df4ac2f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 20 Sep 2014 17:51:23 -0500 Subject: Always call setlocale if I18N is enabled, so nested toy_exec() can switch it back off if necessary. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index cfa2cc9..6e7d267 100644 --- a/main.c +++ b/main.c @@ -66,7 +66,7 @@ static void toy_singleinit(struct toy_list *which, char *argv[]) toys.which = which; toys.argv = argv; - if (CFG_TOYBOX_I18N && (which->flags & TOYFLAG_LOCALE)) setlocale(LC_ALL, ""); + if (CFG_TOYBOX_I18N) setlocale(LC_ALL, "C"+!!(which->flags & TOYFLAG_LOCALE)); if (CFG_TOYBOX_HELP_DASHDASH && argv[1] && !strcmp(argv[1], "--help")) { if (toys.which == toy_list && toys.argv[2]) -- cgit v1.2.3