changeset 1493:74b29c369420

Always call setlocale if I18N is enabled, so nested toy_exec() can switch it back off if necessary.
author Rob Landley <rob@landley.net>
date Sat, 20 Sep 2014 17:51:23 -0500
parents 8bf5f528d352
children ca340df928bc
files main.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main.c	Sat Sep 20 14:20:28 2014 -0500
+++ b/main.c	Sat Sep 20 17:51:23 2014 -0500
@@ -66,7 +66,7 @@
   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])