diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-03-08 03:57:26 +0000 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-03-08 03:57:26 +0000 |
commit | 2f1decd3dde75b8ed601dfdca2833879703012c8 (patch) | |
tree | 0516712500d0595136e9a1da4ece6cf04c22606c /core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch | |
parent | d44823e5676f0edd0e259c7c33d5640a043748ac (diff) |
Sat Mar 8 03:54:50 UTC 2014
Diffstat (limited to 'core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch')
-rw-r--r-- | core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch b/core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch new file mode 100644 index 000000000..d64fe89cc --- /dev/null +++ b/core/systemd/0009-logs-show-fix-corrupt-output-with-empty-messages.patch @@ -0,0 +1,41 @@ +From 47d80904a1f72d559962cc5ad32fffd46672a34a Mon Sep 17 00:00:00 2001 +From: Uoti Urpala <uoti.urpala@pp1.inet.fi> +Date: Thu, 20 Feb 2014 03:00:09 +0200 +Subject: [PATCH] logs-show: fix corrupt output with empty messages + +If a message had zero length, journalctl would print no newline, and +two output lines would be concatenated. Fix. The problem was +introduced in commit 31f7bf199452 ("logs-show: print multiline +messages"). Affected short and verbose output modes. + +Before fix: + +Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit + +after: + +Feb 09 21:16:17 glyph dhclient[1323]: +Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit +--- + src/shared/logs-show.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c +index 61c3652..12d4a1c 100644 +--- a/src/shared/logs-show.c ++++ b/src/shared/logs-show.c +@@ -124,6 +124,11 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output + } + } + ++ /* A special case: make sure that we print a newline when ++ the message is empty. */ ++ if (message_len == 0) ++ fputs("\n", f); ++ + for (pos = message; + pos < message + message_len; + pos = end + 1, line++) { +-- +1.9.0 + |