3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00
guix/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
Marius Bakke 11f87d635c
gnu: jsoncpp: Fix test failure on armhf-linux and aarch64-linux.
* gnu/packages/patches/jsoncpp-fix-inverted-case.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/serialization.scm (jsoncpp)[source](patches): New field.
2020-01-12 20:33:52 +01:00

22 lines
839 B
Diff

This patch fixes a bug and related test failure on platforms where 'char'
is unsigned.
Taken from upstream:
https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb
diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
index 8e06cca2..56195dc1 100644
--- a/src/lib_json/json_writer.cpp
+++ b/src/lib_json/json_writer.cpp
@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
char const* const end = s + n;
for (char const* cur = s; cur < end; ++cur) {
- if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
- static_cast<unsigned char>(*cur) < 0x80)
+ if (*cur == '\\' || *cur == '\"' ||
+ static_cast<unsigned char>(*cur) < ' ' ||
+ static_cast<unsigned char>(*cur) >= 0x80)
return true;
}
return false;