From b8f2e2b11f219e72fdef924b1f259628fa56e5a9 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Thu, 15 Dec 2011 10:27:51 +0000 Subject: [PATCH] main: Fix parsing of plymouth.debug=stream: argument. It did not terminate at space so the log file to use was not properly defined and any additional kernel command line args were added to the end of the file name. --- src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.c b/src/main.c index e230c58b..9565a3e7 100644 --- a/src/main.c +++ b/src/main.c @@ -1797,6 +1797,12 @@ check_verbosity (state_t *state) if (stream != NULL) { + char *end; + + stream = strdup (stream); + end = stream + strcspn (stream, " \n"); + *end = '\0'; + ply_trace ("streaming debug output to %s instead of screen", stream); fd = open (stream, O_RDWR | O_NOCTTY | O_CREAT, 0600); @@ -1808,6 +1814,7 @@ check_verbosity (state_t *state) { ply_logger_set_output_fd (ply_logger_get_error_default (), fd); } + free (stream); } } else