summaryrefslogtreecommitdiff
path: root/sys/arch/aviion
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-04-18 15:05:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-04-18 15:05:27 +0000
commitcb27a651972979c483ce87e456550aba89635e1e (patch)
treedd6633795a5b630d9ddc43ede5618f9c8ea519dd /sys/arch/aviion
parent6675e78b30bad5b8454b5a8dbe8204872a7366cb (diff)
Allow for multiple options after a dash (getopt style).
Diffstat (limited to 'sys/arch/aviion')
-rw-r--r--sys/arch/aviion/aviion/autoconf.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/sys/arch/aviion/aviion/autoconf.c b/sys/arch/aviion/aviion/autoconf.c
index b582ad468c5..024d3e7d7b7 100644
--- a/sys/arch/aviion/aviion/autoconf.c
+++ b/sys/arch/aviion/aviion/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.10 2009/10/26 20:17:27 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.11 2010/04/18 15:05:26 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -113,6 +113,7 @@ diskconf(void)
* driver name.
*/
+/* skip end of token and whitespace */
static char *stws(char *);
static char *
stws(char *p)
@@ -148,20 +149,21 @@ cmdline_parse(void)
p = stws(bootargs);
while (*p != '\0') {
if (*p++ == '-')
- switch (*p) {
- case 'a':
- boothowto |= RB_ASKNAME;
- break;
- case 'b':
- boothowto |= RB_KDB;
- break;
- case 'c':
- boothowto |= RB_CONFIG;
- break;
- case 's':
- boothowto |= RB_SINGLE;
- break;
- }
+ while (*p != ' ' && *p != '\0')
+ switch (*p++) {
+ case 'a':
+ boothowto |= RB_ASKNAME;
+ break;
+ case 'b':
+ boothowto |= RB_KDB;
+ break;
+ case 'c':
+ boothowto |= RB_CONFIG;
+ break;
+ case 's':
+ boothowto |= RB_SINGLE;
+ break;
+ }
p = stws(p);
}
@@ -192,7 +194,8 @@ device_register(struct device *dev, void *aux)
* care about controller and unit numbers.
*/
if (strcmp("le", dev->dv_cfdata->cf_driver->cd_name) == 0 &&
- strcmp("syscon", dev->dv_parent->dv_cfdata->cf_driver->cd_name) == 0)
+ strcmp("syscon",
+ dev->dv_parent->dv_cfdata->cf_driver->cd_name) == 0)
bootdv = dev;
break;
}