зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1667835 - Update jsoncpp to version 1.9.4. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D91623
This commit is contained in:
Родитель
3d3a31abb7
Коммит
39fbdea010
|
@ -1,2 +1 @@
|
|||
6aba23f4a8628d599a9ef7fa4811c4ff6e4070e2
|
||||
|
||||
9059f5cad030ba11d37818847443a53918c327b1
|
||||
|
|
|
@ -342,6 +342,7 @@ public:
|
|||
Value(const StaticString& value);
|
||||
Value(const String& value);
|
||||
Value(bool value);
|
||||
Value(std::nullptr_t ptr) = delete;
|
||||
Value(const Value& other);
|
||||
Value(Value&& other);
|
||||
~Value();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// 3. /CMakeLists.txt
|
||||
// IMPORTANT: also update the SOVERSION!!
|
||||
|
||||
#define JSONCPP_VERSION_STRING "1.9.3"
|
||||
#define JSONCPP_VERSION_STRING "1.9.4"
|
||||
#define JSONCPP_VERSION_MAJOR 1
|
||||
#define JSONCPP_VERSION_MINOR 9
|
||||
#define JSONCPP_VERSION_PATCH 3
|
||||
|
|
|
@ -1175,8 +1175,11 @@ bool OurReader::readToken(Token& token) {
|
|||
if (features_.allowSingleQuotes_) {
|
||||
token.type_ = tokenString;
|
||||
ok = readStringSingleQuote();
|
||||
break;
|
||||
} // else fall through
|
||||
} else {
|
||||
// If we don't allow single quotes, this is a failure case.
|
||||
ok = false;
|
||||
}
|
||||
break;
|
||||
case '/':
|
||||
token.type_ = tokenComment;
|
||||
ok = readComment();
|
||||
|
|
|
@ -175,11 +175,11 @@ String valueToString(double value, unsigned int precision,
|
|||
|
||||
String valueToString(bool value) { return value ? "true" : "false"; }
|
||||
|
||||
static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
|
||||
static bool doesAnyCharRequireEscaping(char const* s, size_t n) {
|
||||
assert(s || !n);
|
||||
|
||||
return std::any_of(s, s + n, [](unsigned char c) {
|
||||
return c == '\\' || c == '"' || !std::isprint(c);
|
||||
return c == '\\' || c == '"' || c < 0x20 || c > 0x7F;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -275,7 +275,7 @@ static String valueToQuotedStringN(const char* value, unsigned length,
|
|||
if (value == nullptr)
|
||||
return "";
|
||||
|
||||
if (!isAnyCharRequiredQuoting(value, length))
|
||||
if (!doesAnyCharRequireEscaping(value, length))
|
||||
return String("\"") + value + "\"";
|
||||
// We have to walk value and escape any special characters.
|
||||
// Appending to String is not efficient, but this should be rare.
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
1.9.3
|
||||
|
||||
1.9.4
|
||||
|
|
Загрузка…
Ссылка в новой задаче