Skip to content

Commit

Permalink
JSONVariantWriter::Write(): do no re-set locale if locale is already "C"
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlson2k committed Feb 18, 2015
1 parent 804e16d commit cfddde9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/utils/JSONVariantWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ string CJSONVariantWriter::Write(const CVariant &value, bool compact)
// Set locale to classic ("C") to ensure valid JSON numbers
const char *currentLocale = setlocale(LC_NUMERIC, NULL);
std::string backupLocale;
if (currentLocale != NULL)
if (currentLocale != NULL && (currentLocale[0] != 'C' || currentLocale[1] != 0))
{
backupLocale = currentLocale;
setlocale(LC_NUMERIC, "C");
Expand Down

0 comments on commit cfddde9

Please sign in to comment.