summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-01-15 00:09:46 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-01-15 00:09:46 +0100
commit3cfe76bec06fbd8bb7e7cb3387866fefbcad674f (patch)
treeb66780d205fb50fd44d0bbb38f5df99cf3167ba1 /gnu/packages/patches/jsoncpp-fix-inverted-case.patch
parentec836b46bf52a5f86c61f50e3a2c3330a7ee3665 (diff)
parent574a71a7a9668aa184661c58e1f18a4d4fccd792 (diff)
downloadguix-patches-3cfe76bec06fbd8bb7e7cb3387866fefbcad674f.tar
guix-patches-3cfe76bec06fbd8bb7e7cb3387866fefbcad674f.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches/jsoncpp-fix-inverted-case.patch')
-rw-r--r--gnu/packages/patches/jsoncpp-fix-inverted-case.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
new file mode 100644
index 0000000000..e4897de1b8
--- /dev/null
+++ b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
@@ -0,0 +1,22 @@
+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;