--- plymouth-0.8.1/src/main.c 2010-04-13 22:04:43.000000000 +0800 +++ main.c 2010-04-13 22:04:32.000000000 +0800 @@ -579,6 +579,19 @@ } static bool +kernel_cmdline_contains_kw(state_t *state, const char * kw) +{ + const int kwlen = strlen(kw); + const char * const pos = strstr (state->kernel_command_line, kw); + if ((pos == NULL) || ((pos != state->kernel_command_line) && (*(pos-1) != ' '))) { + /* kw not found, or kw found but is preceeded by non-space char */ + return 0; + } + /* Keyword found and start is ok. Is kw followed by space or end-of-cmdline? */ + return *(pos+kwlen) == '\0' || *(pos+kwlen) == ' '; +} + +static bool plymouth_should_show_default_splash (state_t *state) { ply_trace ("checking if plymouth should show default splash"); @@ -612,7 +625,8 @@ } } - return strstr (state->kernel_command_line, "rhgb") != NULL || (strstr (state->kernel_command_line, "splash") != NULL && strstr(state->kernel_command_line, "splash=verbose") == NULL); + return kernel_cmdline_contains_kw(state, "rhgb") || + (kernel_cmdline_contains_kw(state, "splash") && !kernel_cmdline_contains_kw(state, "splash=verbose") ); } static void