Added
Link Here
|
1 |
From 607f9887ca85f246e970778e3d40aa5c346365a7 Mon Sep 17 00:00:00 2001 |
2 |
From: Artem Savkov <asavkov@redhat.com> |
3 |
Date: Tue, 28 Sep 2021 18:38:48 +0200 |
4 |
Subject: [PATCH] Fix empty gateway->path with glib > 2.68 |
5 |
|
6 |
Starting with glib 2.69 g_match_info_fetch() returns an empty string |
7 |
instead of NULL in case when no match was found. Properly handle this |
8 |
case. |
9 |
|
10 |
Signed-off-by: Artem Savkov <asavkov@redhat.com> |
11 |
--- |
12 |
src/discord-http.c | 3 +++ |
13 |
1 file changed, 3 insertions(+) |
14 |
|
15 |
diff --git a/src/discord-http.c b/src/discord-http.c |
16 |
index 83b92ce..80b3946 100644 |
17 |
--- a/src/discord-http.c |
18 |
+++ b/src/discord-http.c |
19 |
@@ -175,6 +175,9 @@ static void discord_http_gateway_cb(struct http_request *req) |
20 |
|
21 |
if (dd->gateway->path == NULL) { |
22 |
dd->gateway->path = g_strdup("/?encoding=json&v=6"); |
23 |
+ } else if (g_strcmp0(dd->gateway->path, "") == 0) { |
24 |
+ g_free(dd->gateway->path); |
25 |
+ dd->gateway->path = g_strdup("/?encoding=json&v=6"); |
26 |
} |
27 |
|
28 |
g_match_info_free(match); |