Skip to content

Commit 5149aa7

Browse files
authored
Merge pull request #1409 from bynect/fix-uri
Handle correctly file uri icons
2 parents 162fc27 + e28a74c commit 5149aa7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/icon.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +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;
223+
return uri_path;
225224
} else if (iconname[0] == '/' || iconname[0] == '~') {
226-
// Return absolute path
225+
// NOTE: Paths starting with ~ should have already been handled at this point
227226
return g_strdup(iconname);
228227
} else if (settings.enable_recursive_icon_lookup) {
229228
char *path = find_icon_path(iconname, size);
@@ -266,7 +265,6 @@ char *get_path_from_icon_name(const char *iconname, int size)
266265
else
267266
LOG_I("Found icon '%s' at %s", iconname, path);
268267

269-
g_free(uri_path);
270268
return path;
271269
}
272270

0 commit comments

Comments
 (0)