From d555e73ce04bfc0d8aca92fc853277be7d439df8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 3 Jul 2014 11:57:51 +0200 Subject: simplify logic --- journal-notify.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/journal-notify.c b/journal-notify.c index c524221..63cc601 100644 --- a/journal-notify.c +++ b/journal-notify.c @@ -150,7 +150,6 @@ int main(int argc, char **argv) { fprintf(stderr, "Failed to read message field: %s\n", strerror(-rc)); continue; } - message = g_markup_escape_text(data + 8, length - 8); /* get SYSLOG_IDENTIFIER field */ @@ -161,14 +160,7 @@ int main(int argc, char **argv) { summary = g_markup_escape_text(data + 18, length - 18); /* show notification */ - if (have_regex > 0) { - if (regexec(®ex, message, 0, NULL, 0) == 0) { - if ((rc = notify(summary, message, icon)) < 0) { - fprintf(stderr, "Failed to show notification.\n"); - goto out40; - } - } - } else { + if (have_regex == 0 || regexec(®ex, message, 0, NULL, 0) == 0) { if ((rc = notify(summary, message, icon)) < 0) { fprintf(stderr, "Failed to show notification.\n"); goto out40; -- cgit v1.2.3-54-g00ecf