Fixes for loading kernel with multiboot

While parsing command line, only consider "variable=value" to
be part of environment.

Patch by Antoine Leca.
This commit is contained in:
Ben Gras 2012-02-09 18:49:24 +01:00
parent 3dd49be938
commit 636264c1c6

View file

@ -13,7 +13,6 @@
#include <minix/com.h>
#include <sys/param.h>
#include <machine/partition.h>
#include "../../../boot/image.h"
#include "string.h"
#include "arch_proto.h"
#include "libexec.h"
@ -147,6 +146,8 @@ PRIVATE void mb_print(char *str)
while (*str) {
if (*str == '\n') {
str++;
while (print_col < MULTIBOOT_CONSOLE_COLS)
mb_put_char(' ', print_line, print_col++);
print_line++;
print_col = 0;
continue;
@ -283,10 +284,10 @@ PRIVATE void get_parameters(multiboot_info_t *mbi)
value_i = 0;
while (*p == ' ') p++;
if (!*p) break;
while (*p && *p != '=' && var_i < GRAN - 1)
while (*p && *p != '=' && *p != ' ' && var_i < GRAN - 1)
var[var_i++] = *p++ ;
var[var_i] = 0;
p++; /* skip '=' */
if (*p++ != '=') continue; /* skip if not name=value */
while (*p && *p != ' ' && value_i < GRAN - 1)
value[value_i++] = *p++ ;
value[value_i] = 0;