Add patch from upstream pull request to remove is_error() macro
authorgregor herrmann <gregoa@debian.org>
Sun, 23 Dec 2018 21:55:41 +0000 (22:55 +0100)
committergregor herrmann <gregoa@debian.org>
Sun, 23 Dec 2018 21:55:41 +0000 (22:55 +0100)
which is deprecated in json-c 0.13.1 and later removed competely.

Closes: #915839

debian/patches/replace_removed_is_error.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/replace_removed_is_error.patch b/debian/patches/replace_removed_is_error.patch
new file mode 100644 (file)
index 0000000..913e543
--- /dev/null
@@ -0,0 +1,40 @@
+From 0db8dc6022f67a4e1f49397b8bf519b2a34f74c9 Mon Sep 17 00:00:00 2001
+From: Jelle van der Waa <jelle@vdwaa.nl>
+Date: Wed, 27 Dec 2017 11:05:45 +0100
+Subject: [PATCH] Replace removed is_error macro
+
+The json-c library removed the is_error macro in 0.13, replaced the
+macro calls with a != NULL statement.
+
+Bug-Debian: https://bugs.debian.org/915839
+Bug: https://github.com/gregkh/bti/pull/44
+
+--- a/bti.c
++++ b/bti.c
+@@ -454,7 +454,7 @@
+       struct json_object *val;                                \
+       struct lh_entry *entry;                                 \
+       for (entry = json_object_get_object(obj)->head;         \
+-              ({ if(entry && !is_error(entry)) {              \
++              ({ if(entry && entry != NULL) {         \
+                       key = (char*)entry->k;                  \
+                       val = (struct json_object*)entry->v;    \
+               } ; entry; });                                  \
+@@ -670,7 +670,7 @@
+       /* make global for now */
+       store_session = session;
+-      if (!is_error(jobj)) {
++      if (jobj != NULL) {
+               /* guards against a json pre 0.10 bug */
+               json_parse(jobj,0);
+       }
+@@ -695,7 +695,7 @@
+       /* make global for now */
+       store_session = session;
+-      if (!is_error(jobj)) {
++      if (jobj != NULL) {
+               /* guards against a json pre 0.10 bug */
+               if (json_object_get_type(jobj)==json_type_array) {
+                       json_parse_array(jobj, NULL, 0);
index c1282b6..9491c3d 100644 (file)
@@ -1,3 +1,4 @@
 manpage-debian.patch
 spelling.patch
 no-more-identi.ca-statusnet.patch
+replace_removed_is_error.patch