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 <asavkov@redhat.com>
This commit is contained in:
parent
eb768b4a81
commit
607f9887ca
|
@ -175,6 +175,9 @@ static void discord_http_gateway_cb(struct http_request *req)
|
||||||
|
|
||||||
if (dd->gateway->path == NULL) {
|
if (dd->gateway->path == NULL) {
|
||||||
dd->gateway->path = g_strdup("/?encoding=json&v=6");
|
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);
|
g_match_info_free(match);
|
||||||
|
|
Loading…
Reference in New Issue