From 584ba20bd31fede8d71c5659208d4a16d55012a3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 24 Jan 2008 05:15:42 +0000 Subject: Fix locale problems in ingen, flowcanvas, and redlandmm (',' decimal point). git-svn-id: http://svn.drobilla.net/lad/ingen@1111 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/DeprecatedLoader.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libs') diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index 8c8d3936..b193c86f 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -94,7 +94,14 @@ DeprecatedLoader::add_variable(GraphObject::Variables& data, string old_key, str // Hack to make module-x and module-y set as floats char* c_val = strdup(value.c_str()); char* endptr = NULL; + + // FIXME: locale kludges + char* locale = strdup(setlocale(LC_NUMERIC, NULL)); + float fval = strtof(c_val, &endptr); + + setlocale(LC_NUMERIC, locale); + free(locale); if (endptr != c_val && *endptr == '\0') data[key] = Atom(fval); -- cgit v1.2.1