]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Fix console iterating patch from two commits ago
authorRay Strode <rstrode@redhat.com>
Fri, 5 Sep 2008 19:09:07 +0000 (15:09 -0400)
committerRay Strode <rstrode@redhat.com>
Fri, 5 Sep 2008 19:09:07 +0000 (15:09 -0400)
It was an infinite loop

src/main.c

index 21bfae261aa78baf21a6bb10db5b234817d182cd..71508c4a87353b7a59bfc3a27b1958003dd37afa 100644 (file)
@@ -485,10 +485,12 @@ static void
 check_for_serial_console (state_t *state)
 {
   char *console_key;
+  char *remaining_command_line;
 
   ply_trace ("checking if splash screen should be disabled");
 
-  while ((console_key = strstr (state->kernel_command_line, " console=")) != NULL)
+  remaining_command_line = state->kernel_command_line;
+  while ((console_key = strstr (remaining_command_line, " console=")) != NULL)
     {
       char *end;
       ply_trace ("serial console found!");
@@ -496,6 +498,8 @@ check_for_serial_console (state_t *state)
       free (state->console);
       state->console = strdup (console_key + strlen (" console="));
 
+      remaining_command_line = console_key + strlen (state->console) + strlen (" console=");
+
       end = strpbrk (state->console, " \n\t\v,");
 
       if (end != NULL)