From 9aba54625832841cbbd582a72a127d0e99c911a2 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Fri, 6 Oct 2017 20:04:30 +0200 Subject: [PATCH] Work around non-gnu basename implementations Redo #354, as it got pushed out in #365 --- src/notification.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/notification.c b/src/notification.c index 18be083..e8325b2 100644 --- a/src/notification.c +++ b/src/notification.c @@ -326,6 +326,7 @@ int notification_init(notification *n, int id) substr = strchr(substr, '%')){ char pg[16]; + char *icon_tmp; switch(substr[1]){ case 'a': @@ -350,11 +351,13 @@ int notification_init(notification *n, int id) n->markup); break; case 'I': + icon_tmp = g_strdup(n->icon); notification_replace_single_field( &n->msg, &substr, - n->icon ? basename(n->icon) : "", + icon_tmp ? basename(icon_tmp) : "", MARKUP_NO); + g_free(icon_tmp); break; case 'i': notification_replace_single_field(