diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-04-22 02:15:18 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2022-04-25 19:13:22 +0200 |
commit | f9c1cf1b718e46f934bd4fdfb1d6ff62a0d063b6 (patch) | |
tree | 970d0e547295b0b58fc2a62e536fbc0a3da3567d | |
parent | 997e2e374a77cc4b02777efdc02d8338da11fb30 (diff) | |
download | libnotify-f9c1cf1b718e46f934bd4fdfb1d6ff62a0d063b6.tar.gz |
notification: Keep converted URIs as such when we prepend a path
-rw-r--r-- | libnotify/notification.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libnotify/notification.c b/libnotify/notification.c index 54d8169..fef195e 100644 --- a/libnotify/notification.c +++ b/libnotify/notification.c @@ -536,14 +536,18 @@ try_prepend_path (const char *base_path, { gchar *path_filename; gchar *path_ret; + gboolean was_uri; if (!path || *path == '\0') return NULL; + was_uri = TRUE; path_ret = NULL; path_filename = g_filename_from_uri (base_path, NULL, NULL); if (path_filename == NULL) { + was_uri = FALSE; + if (base_path && base_path[0] == G_DIR_SEPARATOR) { path_filename = g_strdup (base_path); } else { @@ -571,6 +575,13 @@ try_prepend_path (const char *base_path, g_debug ("Nothing found at %s", path_ret); g_free (path_ret); path_ret = NULL; + } else if (was_uri) { + gchar *uri = g_filename_to_uri (path_ret, NULL, NULL); + + if (uri != NULL) { + g_free (path_ret); + path_ret = uri; + } } g_free (path_filename); |