Work around non-gnu basename implementations

Redo #354, as it got pushed out in #365
This commit is contained in:
Benedikt Heine 2017-10-06 20:04:30 +02:00
parent 82d544e95e
commit 9aba546258

View File

@ -326,6 +326,7 @@ int notification_init(notification *n, int id)
substr = strchr(substr, '%')){ substr = strchr(substr, '%')){
char pg[16]; char pg[16];
char *icon_tmp;
switch(substr[1]){ switch(substr[1]){
case 'a': case 'a':
@ -350,11 +351,13 @@ int notification_init(notification *n, int id)
n->markup); n->markup);
break; break;
case 'I': case 'I':
icon_tmp = g_strdup(n->icon);
notification_replace_single_field( notification_replace_single_field(
&n->msg, &n->msg,
&substr, &substr,
n->icon ? basename(n->icon) : "", icon_tmp ? basename(icon_tmp) : "",
MARKUP_NO); MARKUP_NO);
g_free(icon_tmp);
break; break;
case 'i': case 'i':
notification_replace_single_field( notification_replace_single_field(