]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: Fix parsing of plymouth.debug=stream: argument.
authorColin Guthrie <colin@mageia.org>
Thu, 15 Dec 2011 10:27:51 +0000 (10:27 +0000)
committerRay Strode <rstrode@redhat.com>
Wed, 21 Mar 2012 14:36:12 +0000 (10:36 -0400)
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

index e230c58b73f97ed3af1d4c4f6fe8c87c2f86f3da..9565a3e781d10eb7118014c29b1970f3351ab79b 100644 (file)
@@ -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