diff -urN main/cfgparser.c main_olo/cfgparser.c --- main/cfgparser.c 2002-10-06 07:54:12.000000000 +0200 +++ main_olo/cfgparser.c 2002-10-18 16:35:39.000000000 +0200 @@ -16,6 +16,11 @@ #include #include #include + +#ifdef USE_SETLOCALE +#include +#endif + #include "config.h" #include "mp_msg.h" @@ -550,25 +555,22 @@ case CONF_TYPE_FLOAT: if (param == NULL) goto err_missing_param; - + /* Use portable C locale for parsing floats: */ +#ifdef USE_SETLOCALE + setlocale(LC_NUMERIC, "C"); +#endif tmp_float = strtod(param, &endptr); switch(*endptr) { case ':': case '/': tmp_float /= strtod(endptr+1, &endptr); - break; - case '.': - case ',': - /* we also handle floats specified with - * non-locale decimal point ::atmos - */ - if(tmp_float<0) - tmp_float -= 1.0/pow(10,strlen(endptr+1)) * strtod(endptr+1, &endptr); - else - tmp_float += 1.0/pow(10,strlen(endptr+1)) * strtod(endptr+1, &endptr); + default: break; } +#ifdef USE_SETLOCALE + setlocale(LC_NUMERIC, ""); +#endif if (*endptr) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "parameter must be a floating point number" diff -urN main/input/input.c main_olo/input/input.c --- main/input/input.c 2002-10-17 17:41:20.000000000 +0200 +++ main_olo/input/input.c 2002-10-18 16:40:42.000000000 +0200 @@ -11,6 +11,10 @@ #include #include +#ifdef USE_SETLOCALE +#include +#endif + #include "input.h" #include "mouse.h" #ifdef MP_DEBUG @@ -465,7 +469,14 @@ break; case MP_CMD_ARG_FLOAT: errno = 0; + /* Use portable C locale for parsing floats: */ +#ifdef USE_SETLOCALE + setlocale(LC_NUMERIC, "C"); +#endif cmd->args[i].v.f = atof(ptr); +#ifdef USE_SETLOCALE + setlocale(LC_NUMERIC, ""); +#endif if(errno != 0) { mp_msg(MSGT_INPUT,MSGL_ERR,"Command %s : argument %d isn't a float\n",cmd_def->name,i+1); ptr = NULL;