diff options
author | Christian Hesse <mail@eworm.de> | 2014-07-03 11:57:51 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-07-03 11:57:51 +0200 |
commit | d555e73ce04bfc0d8aca92fc853277be7d439df8 (patch) | |
tree | b078f79b2eaf410a31ca6f61318a6f75288e4cdf | |
parent | e2a3a1c2d760ec2ccf667269ed06f4d856e4437b (diff) | |
download | journal-notify-d555e73ce04bfc0d8aca92fc853277be7d439df8.tar.gz journal-notify-d555e73ce04bfc0d8aca92fc853277be7d439df8.tar.zst |
simplify logic
-rw-r--r-- | journal-notify.c | 10 |
1 files changed, 1 insertions, 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; |