mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 08:26:52 +03:00
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.
This commit is contained in:
parent
37c47e5e5b
commit
ec5ff4445c
Notes:
Lennart Poettering
2015-06-18 00:05:07 +02:00
Backport: bugfix
@ -234,7 +234,8 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
|
|||||||
if (t)
|
if (t)
|
||||||
*identifier = t;
|
*identifier = t;
|
||||||
|
|
||||||
e += strspn(p + e, WHITESPACE);
|
if (strchr(WHITESPACE, p[e]))
|
||||||
|
e++;
|
||||||
*buf = p + e;
|
*buf = p + e;
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user