Never treat revisions as numbers in JSON.

As it leads to invalid output. Fixes #454.
This commit is contained in:
Oliver Hamlet
2015-06-19 12:39:17 +01:00
parent 357c60541d
commit 27d96d7242
+2 -2
View File
@@ -62,8 +62,8 @@ namespace loot {
boost::replace_all(json, "\": ~", "\": null");
// Using the definition at <http://www.json.org/>.
// Version numbers should be kept as strings though.
boost::regex numbers("\"(?!version)([^\"]+)\": \"(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\"", boost::regex::ECMAScript);
// Version numbers and revision IDs should be kept as strings though.
boost::regex numbers("\"(?!version|revision)([^\"]+)\": \"(-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\"", boost::regex::ECMAScript);
json = boost::regex_replace(json, numbers, "\"$1\": $2");