Skip to content

Commit 9c6cfdf

Browse files
committed
Handle correctly file uri icons
1 parent 9a79724 commit 9c6cfdf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/icon.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ char *get_path_from_icon_name(const char *iconname, int size)
214214
if (STR_EMPTY(iconname))
215215
return NULL;
216216

217-
char *uri_path = NULL;
218217
if (g_str_has_prefix(iconname, "file://")) {
219218
char *uri_path = g_filename_from_uri(iconname, NULL, NULL);
220219
if (STR_EMPTY(uri_path)) {
221220
LOG_W("Invalid file uri '%s'", iconname);
222221
return NULL;
223222
}
224-
iconname = uri_path;
225-
} else if (iconname[0] == '/' || iconname[0] == '~') {
223+
return uri_path;
224+
} else if (iconname[0] == '/') {
225+
// NOTE: Paths starting with ~ should have already been handled
226226
// Return absolute path
227227
return g_strdup(iconname);
228228
} else if (settings.enable_recursive_icon_lookup) {
@@ -266,7 +266,6 @@ char *get_path_from_icon_name(const char *iconname, int size)
266266
else
267267
LOG_I("Found icon '%s' at %s", iconname, path);
268268

269-
g_free(uri_path);
270269
return path;
271270
}
272271

0 commit comments

Comments
 (0)