summaryrefslogtreecommitdiffstats
path: root/journal-notify.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-07-03 11:57:51 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-07-03 11:57:51 +0200
commitd555e73ce04bfc0d8aca92fc853277be7d439df8 (patch)
treeb078f79b2eaf410a31ca6f61318a6f75288e4cdf /journal-notify.c
parente2a3a1c2d760ec2ccf667269ed06f4d856e4437b (diff)
downloadjournal-notify-d555e73ce04bfc0d8aca92fc853277be7d439df8.tar.gz
journal-notify-d555e73ce04bfc0d8aca92fc853277be7d439df8.tar.zst
simplify logic
Diffstat (limited to 'journal-notify.c')
-rw-r--r--journal-notify.c10
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(&regex, 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(&regex, message, 0, NULL, 0) == 0) {
if ((rc = notify(summary, message, icon)) < 0) {
fprintf(stderr, "Failed to show notification.\n");
goto out40;