replace string "\n" with char '\n'
this way we don't need the extra check for the string "\n" in do_word_wrap and rstrip strips newlines away. fixes github issue #80
This commit is contained in:
parent
f054dab8be
commit
f46f9bff17
9
dunst.c
9
dunst.c
@ -533,11 +533,6 @@ int do_word_wrap(char *source, int max_width)
|
||||
*eol = '\0';
|
||||
return 1 + do_word_wrap(eol + 1, max_width);
|
||||
}
|
||||
if (*eol == '\\' && *(eol + 1) == 'n') {
|
||||
*eol = ' ';
|
||||
*(eol + 1) = '\0';
|
||||
return 1 + do_word_wrap(eol + 2, max_width);
|
||||
}
|
||||
|
||||
if (word_wrap && max_width > 0) {
|
||||
if (textnw(dc, source, (eol - source) + 1) >= max_width) {
|
||||
@ -1070,6 +1065,10 @@ int init_notification(notification * n, int id)
|
||||
}
|
||||
|
||||
n->msg = fix_markup(n->msg);
|
||||
|
||||
while (strstr(n->msg, "\\n") != NULL)
|
||||
n->msg = string_replace("\\n", "\n", n->msg);
|
||||
|
||||
n->msg = rstrip(n->msg);
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user