Blame SOURCES/0187-journald-do-not-strip-leading-whitespace-from-messag.patch

17b0f1
From fa74ba131041161f1ae9fbc0a3b11f9a005b9d8f Mon Sep 17 00:00:00 2001
17b0f1
From: Filipe Brandenburger <filbranden@google.com>
17b0f1
Date: Wed, 10 Jun 2015 22:33:44 -0700
17b0f1
Subject: [PATCH] journald: do not strip leading whitespace from messages
17b0f1
17b0f1
Keep leading whitespace for compatibility with older syslog
17b0f1
implementations.  Also useful when piping formatted output to the
17b0f1
`logger` command.  Keep removing trailing whitespace.
17b0f1
17b0f1
Tested with `pstree | logger` and checking that the output of
17b0f1
`journalctl | tail` included aligned and formatted output.
17b0f1
17b0f1
Confirmed that all test cases still pass as expected.
17b0f1
17b0f1
Cherry-picked from: ec5ff444
17b0f1
Resolves: #1227396
17b0f1
---
17b0f1
 src/journal/journald-syslog.c | 3 ++-
17b0f1
 1 file changed, 2 insertions(+), 1 deletion(-)
17b0f1
17b0f1
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
17b0f1
index 7d545ca31d..ba80941d7b 100644
17b0f1
--- a/src/journal/journald-syslog.c
17b0f1
+++ b/src/journal/journald-syslog.c
17b0f1
@@ -232,7 +232,8 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
17b0f1
         if (t)
17b0f1
                 *identifier = t;
17b0f1
 
17b0f1
-        e += strspn(p + e, WHITESPACE);
17b0f1
+        if (strchr(WHITESPACE, p[e]))
17b0f1
+                e++;
17b0f1
         *buf = p + e;
17b0f1
         return e;
17b0f1
 }