Merge pull request #403 from bebehei/redo-354

Work around non-gnu basename implementations
This commit is contained in:
Nikos Tsipinakis 2017-10-06 22:24:39 +03:00 committed by GitHub
commit 478377815f

View File

@ -335,6 +335,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':
@ -359,11 +360,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(