Bug fix #143: Move setlocale(LC_NUMERIC, "C")

Move setlocale(LC_NUMERIC, "C") to a better place, in hope to fix #143.
Thanks to hiciu for reporting!
This commit is contained in:
Richard Grenville 2013-09-14 10:04:38 +08:00
parent e9d187f03e
commit 5da802634a
1 changed files with 4 additions and 4 deletions

View File

@ -5390,16 +5390,16 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
ps->o.wintype_opacity[i] = 1.0; ps->o.wintype_opacity[i] = 1.0;
} }
// Enforce LC_NUMERIC locale "C" here to make sure dots are recognized
// instead of commas in atof().
setlocale(LC_NUMERIC, "C");
#ifdef CONFIG_LIBCONFIG #ifdef CONFIG_LIBCONFIG
parse_config(ps, &cfgtmp); parse_config(ps, &cfgtmp);
#endif #endif
// Parse commandline arguments. Range checking will be done later. // Parse commandline arguments. Range checking will be done later.
// Enforce LC_NUMERIC locale "C" here to make sure dots are recognized
// instead of commas in atof().
setlocale(LC_NUMERIC, "C");
optind = 1; optind = 1;
while (-1 != while (-1 !=
(o = getopt_long(argc, argv, shortopts, longopts, &longopt_idx))) { (o = getopt_long(argc, argv, shortopts, longopts, &longopt_idx))) {