From bbea6cc6d47123aafd88cd11ee5dccda6c776b89 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 24 Feb 2013 21:00:17 +0100 Subject: options: remove parsing of "," as decimal point Apparently the intention was parsing numbers reliably in presence of non-C locales. mpv is always in C locale, and not being in C locale would probably break even more things, so remove this code. --- core/m_option.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'core') diff --git a/core/m_option.c b/core/m_option.c index 85657aa497..883ecd70a0 100644 --- a/core/m_option.c +++ b/core/m_option.c @@ -535,23 +535,8 @@ static int parse_double(const m_option_t *opt, struct bstr name, struct bstr rest; double tmp_float = bstrtod(param, &rest); - switch (rest.len ? rest.start[0] : 0) { - case ':': - case '/': - tmp_float /= bstrtod(bstr_cut(rest, 1), &rest); - break; - case '.': - case ',': - /* we also handle floats specified with - * non-locale decimal point ::atmos - */ - rest = bstr_cut(rest, 1); - if (tmp_float < 0) - tmp_float -= 1.0 / pow(10, rest.len) * bstrtod(rest, &rest); - else - tmp_float += 1.0 / pow(10, rest.len) * bstrtod(rest, &rest); - break; - } + if (bstr_eatstart0(&rest, ":") || bstr_eatstart0(&rest, "/")) + tmp_float /= bstrtod(rest, &rest); if (rest.len) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, -- cgit v1.2.3