void-packages/srcpkgs/bti/patches/0db8dc6022f67a4e1f49397b8bf519b2a34f74c9.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: convert patches to -Np1
```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

42 lines
1.4 KiB
Diff

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.
---
bti.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bti.c b/bti.c
index 7f485a8..9b68e17 100644
--- a/bti.c
+++ b/bti.c
@@ -451,7 +451,7 @@ static void parse_timeline(char *document, struct session *session)
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; }); \
@@ -667,7 +667,7 @@ static int parse_response_json(char *document, struct session *session)
/* 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);
}
@@ -692,7 +692,7 @@ static void parse_timeline_json(char *document, struct session *session)
/* 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);