]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: break out of loop when hitting trailing new line
authorRay Strode <rstrode@redhat.com>
Wed, 4 Apr 2012 15:38:45 +0000 (11:38 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 4 Apr 2012 15:38:45 +0000 (11:38 -0400)
It's important to ignore chunks of the active tty buffer
that are just whitespace.

src/main.c

index 5a2f8b18bf942ba5f1c60d27646a08a00d3ec4a4..72d9f95edcacbec02eb17e177d18e2eb6c08c8c1 100644 (file)
@@ -1918,6 +1918,12 @@ add_consoles_from_file (state_t         *state,
       if (end != NULL)
         *end = '\0';
 
+      if (console[0] == '\0')
+        {
+          free (console);
+          break;
+        }
+
       console_length = strlen (console);
 
       asprintf (&console_device, "/dev/%s", console);