From 00b73ea5ff156899af5245f111ebdcf3e0e6ed0c Mon Sep 17 00:00:00 2001 From: Peter Bui Date: Sun, 17 Oct 2021 23:28:21 -0400 Subject: [PATCH] bitlbee-discord: add fix for glib >= 2.69 Fixes #33412 --- .../bitlbee-discord/patches/glib-2.69.patch | 28 +++++++++++++++++++ srcpkgs/bitlbee-discord/template | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/bitlbee-discord/patches/glib-2.69.patch diff --git a/srcpkgs/bitlbee-discord/patches/glib-2.69.patch b/srcpkgs/bitlbee-discord/patches/glib-2.69.patch new file mode 100644 index 000000000000..6eff3f5e106f --- /dev/null +++ b/srcpkgs/bitlbee-discord/patches/glib-2.69.patch @@ -0,0 +1,28 @@ +From 607f9887ca85f246e970778e3d40aa5c346365a7 Mon Sep 17 00:00:00 2001 +From: Artem Savkov +Date: Tue, 28 Sep 2021 18:38:48 +0200 +Subject: [PATCH] Fix empty gateway->path with glib > 2.68 + +Starting with glib 2.69 g_match_info_fetch() returns an empty string +instead of NULL in case when no match was found. Properly handle this +case. + +Signed-off-by: Artem Savkov +--- + src/discord-http.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/discord-http.c b/src/discord-http.c +index 83b92ce..80b3946 100644 +--- a/src/discord-http.c ++++ b/src/discord-http.c +@@ -175,6 +175,9 @@ static void discord_http_gateway_cb(struct http_request *req) + + if (dd->gateway->path == NULL) { + dd->gateway->path = g_strdup("/?encoding=json&v=6"); ++ } else if (g_strcmp0(dd->gateway->path, "") == 0) { ++ g_free(dd->gateway->path); ++ dd->gateway->path = g_strdup("/?encoding=json&v=6"); + } + + g_match_info_free(match); diff --git a/srcpkgs/bitlbee-discord/template b/srcpkgs/bitlbee-discord/template index 4fda22d15710..daa18792b8a6 100644 --- a/srcpkgs/bitlbee-discord/template +++ b/srcpkgs/bitlbee-discord/template @@ -1,7 +1,7 @@ # Template file for 'bitlbee-discord' pkgname=bitlbee-discord version=0.4.3 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="libtool automake pkg-config glib-devel" makedepends="bitlbee-devel json-glib-devel"