Mercurial > hvf > hvf-old
changeset 550:7e73e6ff42c4
cp: handle leading spaces & multiple blanks in the system config
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Wed, 27 Apr 2011 20:19:27 -0400 |
parents | e53b2f8b0d25 |
children | 7a993f206b86 |
files | cp/nucleus/config.c |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/cp/nucleus/config.c Wed Apr 27 20:18:42 2011 -0400 +++ b/cp/nucleus/config.c Wed Apr 27 20:19:27 2011 -0400 @@ -40,10 +40,10 @@ { char *t1, *t2; - if ((t1 = strsep(&s, " ")) == NULL) + if ((t1 = strmsep(&s, " ")) == NULL) return -EINVAL; - if ((t2 = strsep(&s, " ")) == NULL) + if ((t2 = strmsep(&s, " ")) == NULL) return -EINVAL; if (!strcmp(t1, "CONSOLE")) { @@ -64,10 +64,10 @@ char *t1, *t2; - if ((t1 = strsep(&s, " ")) == NULL) + if ((t1 = strmsep(&s, " ")) == NULL) return -EINVAL; - if ((t2 = strsep(&s, " ")) == NULL) + if ((t2 = strmsep(&s, " ")) == NULL) return -EINVAL; ret = __get_u16(t1, &devnum); @@ -101,20 +101,20 @@ u16 devtype; int ret; - if ((conn = strsep(&s, " ")) == NULL) + if ((conn = strmsep(&s, " ")) == NULL) return -EINVAL; - if ((_devtype = strsep(&s, " ")) == NULL) + if ((_devtype = strmsep(&s, " ")) == NULL) return -EINVAL; ret = __get_u16(_devtype, &devtype); if (ret) return ret; - if ((fn = strsep(&s, " ")) == NULL) + if ((fn = strmsep(&s, " ")) == NULL) return -EINVAL; - if ((ft = strsep(&s, " ")) == NULL) + if ((ft = strmsep(&s, " ")) == NULL) return -EINVAL; logo = malloc(sizeof(struct logo), ZONE_NORMAL); @@ -156,7 +156,7 @@ if (stmnt[0] == '\0') return 0; /* empty line */ - if ((tok = strsep(&s, " ")) != NULL) { + if ((tok = strmsep(&s, " ")) != NULL) { if (!strcmp(tok, "OPERATOR")) return __parse_operator(s); else if (!strcmp(tok, "RDEV"))