mirror of
https://github.com/json-c/json-c.git
synced 2026-04-05 13:29:06 +08:00
Issue #195: Actually call uselocale() in the new locale handling code in json_tokener.
Also, be sure the right locale_t is freed if we fail on the second uselocale. Finally, fix test_locale so it *doesn't* use json_object_to_json_string as that will simple re-emit the original parsed string values.
This commit is contained in:
@@ -262,12 +262,16 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
|
||||
// XXX at least Debian 8.4 has a bug in newlocale where it doesn't
|
||||
// change the decimal separator unless you set LC_TIME!
|
||||
if (newloc)
|
||||
newloc = newlocale(LC_TIME, "C", newloc);
|
||||
{
|
||||
duploc = newloc; // original duploc has been freed by newlocale()
|
||||
newloc = newlocale(LC_TIME, "C", duploc);
|
||||
}
|
||||
if (newloc == NULL)
|
||||
{
|
||||
freelocale(duploc);
|
||||
return NULL;
|
||||
}
|
||||
uselocale(newloc);
|
||||
}
|
||||
#elif defined(HAVE_SETLOCALE)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user