From: Peter Jones Date: Wed, 4 Jun 2008 16:55:32 +0000 (-0400) Subject: Make plymouth_should_be_running() be less manual, and add " init=" handler. X-Git-Tag: 0.2.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44ab737bd0929d7d3eeac01ebbcd59916c56471a;p=thirdparty%2Fplymouth.git Make plymouth_should_be_running() be less manual, and add " init=" handler. --- diff --git a/src/main.c b/src/main.c index a4910045..a3bf3b5a 100644 --- a/src/main.c +++ b/src/main.c @@ -415,22 +415,23 @@ plymouth_should_be_running (state_t *state) { ply_trace ("checking if plymouth should be running"); - if ((strstr (state->kernel_command_line, " single ") != NULL) - || (strstr (state->kernel_command_line, "single ") != NULL) - || (strstr (state->kernel_command_line, " single") != NULL)) - { - ply_trace ("kernel command line has option 'single'"); - return false; - } + const char const *strings[] = { + " single ", " single", "single ", + " 1 ", " 1", "1 ", + " init=", + NULL + }; + int i; - if ((strstr (state->kernel_command_line, " 1 ") != NULL) - || (strstr (state->kernel_command_line, "1 ") != NULL) - || (strstr (state->kernel_command_line, " 1") != NULL)) + for (i = 0; strings[i] != NULL; i++) { - ply_trace ("kernel command line has option '1'"); - return false; + if (strstr (state->kernel_command_line, strings[i]) != NULL) + { + ply_trace ("kernel command line has option \"%s\"", strings[i]); + return false; + } } - + return true; }