diff options
author | Roland McGrath <roland@gnu.org> | 2001-10-07 19:47:11 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-10-07 19:47:11 +0000 |
commit | c86713cf7417cd985e2e812fd27132ae729b3bfb (patch) | |
tree | d3da9873484dc7766b6cbf52e9e154950e7ff7fa /kern | |
parent | 40478c35627c3f560eb3f584d6f921dc0c8d3b9e (diff) |
2001-10-07 Roland McGrath <roland@frob.com>
* kern/bootstrap.c (bootstrap_create): Fix inverted test logic for
compatibility case. Ignore trailing newlines after space for
compatibility detection.
Reported by Neal H Walfield <neal@cs.uml.edu>.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/bootstrap.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 2d9e456..bef281b 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -99,28 +99,24 @@ void bootstrap_create() { struct multiboot_module *bmods = ((struct multiboot_module *) phystokv(boot_info.mods_addr)); - char *p; + int compat; if (!(boot_info.flags & MULTIBOOT_MODS) || (boot_info.mods_count == 0)) panic ("No bootstrap code loaded with the kernel!"); - if (boot_info.mods_count == 1) + compat = boot_info.mods_count == 1; + if (compat) { - p = strchr((char*)phystokv(bmods[0].string), ' '); + char *p = strchr((char*)phystokv(bmods[0].string), ' '); if (p != 0) - { - do - ++p; - while (*p == ' '); - if (*p == '\0') - p = 0; - } + do + ++p; + while (*p == ' ' || *p == '\n'); + compat = p == 0 || *p == '\0'; } - else - p = 0; - if (p == 0) + if (compat) { printf("Loading single multiboot module in compat mode: %s\n", (char*)phystokv(bmods[0].string)); |