From: Filipe Brandenburger Date: Thu, 11 Jun 2015 05:33:44 +0000 (-0700) Subject: journald: do not strip leading whitespace from messages X-Git-Tag: v221~112^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec5ff4445cca6a1d786b8da36cf6fe0acc0b94c8;p=thirdparty%2Fsystemd.git journald: do not strip leading whitespace from messages Keep leading whitespace for compatibility with older syslog implementations. Also useful when piping formatted output to the `logger` command. Keep removing trailing whitespace. Tested with `pstree | logger` and checking that the output of `journalctl | tail` included aligned and formatted output. Confirmed that all test cases still pass as expected. --- diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 90b75309463..ffba451955f 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -234,7 +234,8 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) if (t) *identifier = t; - e += strspn(p + e, WHITESPACE); + if (strchr(WHITESPACE, p[e])) + e++; *buf = p + e; return e; }