summaryrefslogtreecommitdiffstats
path: root/core/m_option.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-24 21:00:17 +0100
committerwm4 <wm4@nowhere>2013-02-26 01:55:52 +0100
commitbbea6cc6d47123aafd88cd11ee5dccda6c776b89 (patch)
treed52404f8f2980693a84bbafb2f3e9ad60ebaf002 /core/m_option.c
parent05f76c63d5c8440c9f9dfc5bb6409e9a0c6f9f55 (diff)
downloadmpv-bbea6cc6d47123aafd88cd11ee5dccda6c776b89.tar.bz2
mpv-bbea6cc6d47123aafd88cd11ee5dccda6c776b89.tar.xz
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.
Diffstat (limited to 'core/m_option.c')
-rw-r--r--core/m_option.c19
1 files changed, 2 insertions, 17 deletions
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,