Permalink
Browse files

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.
  • Loading branch information...
filbranden committed Jun 11, 2015
1 parent 37c47e5 commit ec5ff4445cca6a1d786b8da36cf6fe0acc0b94c8
Showing with 2 additions and 1 deletion.
  1. +2 −1 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;
}

0 comments on commit ec5ff44

Please sign in to comment.