bootpath_build(): implement slighly more clever algorith to find boot

flags in the bootpath: only treat the rest as boot flags if the '-'
follows whitespace (space or tab)

This should fix the "boot disk4 netbsd-20001004-RFHS8036" lossage
Hubert Feyer pointed out in private e-mail.

Tested by: jdolecek (userland version)
Reviewed by: eeh
This commit is contained in:
jdolecek 2000-10-04 23:05:08 +00:00
parent e9e1084ea3
commit 2fa1ccfa6e

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.40 2000/09/27 18:16:01 eeh Exp $ */
/* $NetBSD: autoconf.c,v 1.41 2000/10/04 23:05:08 jdolecek Exp $ */
/*
* Copyright (c) 1996
@ -314,11 +314,17 @@ bootpath_build()
/* Setup pointer to boot flags */
OF_getprop(chosen, "bootargs", buf, sizeof(buf));
cp = buf;
if (cp == NULL)
/* Find start of boot flags */
while (*cp) {
while(*cp == ' ' || *cp == '\t') cp++;
if (*cp == '-' || *cp == '\0')
break;
while(*cp != ' ' && *cp != '\t' && *cp != '\0') cp++;
}
if (*cp != '-')
return;
while (*cp != '-')
if (*cp++ == '\0')
return;
for (;*++cp;) {
int fl;