summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@ubuntu.com>2010-04-28 13:28:34 +0100
committerRay Strode <rstrode@redhat.com>2010-05-03 10:00:38 -0400
commit7021306e43aab0f64f829ea09d0645f2b32c97f3 (patch)
treea6acddad617b9fe154f0b3575fa1da11a91250ed
parent38f681280a7d500632844ce284609e2becbc4e20 (diff)
Handle plymouth:splash or plymouth:debug as last argument
If plymouth:splash or plymouth:debug is the last argument in /proc/cmdline, then it will be terminated with '\n' rather than ' '. Handle this.
-rw-r--r--src/main.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 9bd66a03..13fed2b6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -221,10 +221,8 @@ find_override_splash (state_t *state)
char *end;
splash_string = strdup (splash_string + strlen ("plymouth:splash="));
- end = strstr (splash_string, " ");
-
- if (end != NULL)
- *end = '\0';
+ end = splash_string + strcspn (splash_string, " \n");
+ *end = '\0';
ply_trace ("Splash is configured to be '%s'", splash_string);
@@ -1558,12 +1556,8 @@ check_verbosity (state_t *state)
path += strlen (" plymouth:debug=file:");
debug_buffer_path = strdup (path);
- end = strstr (debug_buffer_path, " ");
-
- if (end != NULL)
- *end = '\0';
-
- debug_buffer_path = path;
+ end = debug_buffer_path + strcspn (debug_buffer_path, " \n");
+ *end = '\0';
}
if (debug_buffer == NULL)