aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/lib/cmdline.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/x86/lib/cmdline.c b/arch/x86/lib/cmdline.c
index 49548bed2301..ff8d1beead6c 100644
--- a/arch/x86/lib/cmdline.c
+++ b/arch/x86/lib/cmdline.c
@@ -72,18 +72,26 @@ int cmdline_find_option_bool(const char *cmdline, const char *option)
72 */ 72 */
73 if (!c || myisspace(c)) 73 if (!c || myisspace(c))
74 return wstart; 74 return wstart;
75 else 75 /*
76 state = st_wordskip; 76 * We hit the end of the option, but _not_
77 * the end of a word on the cmdline. Not
78 * a match.
79 */
77 } else if (!c) { 80 } else if (!c) {
78 /* 81 /*
79 * Hit the NULL terminator on the end of 82 * Hit the NULL terminator on the end of
80 * cmdline. 83 * cmdline.
81 */ 84 */
82 return 0; 85 return 0;
83 } else if (c != *opptr++) { 86 } else if (c == *opptr++) {
84 state = st_wordskip; 87 /*
88 * We are currently matching, so continue
89 * to the next character on the cmdline.
90 */
91 break;
85 } 92 }
86 break; 93 state = st_wordskip;
94 /* fall through */
87 95
88 case st_wordskip: 96 case st_wordskip:
89 if (!c) 97 if (!c)