summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale S. Rahn <rahnds@cvs.openbsd.org>2000-01-24 03:07:55 +0000
committerDale S. Rahn <rahnds@cvs.openbsd.org>2000-01-24 03:07:55 +0000
commit27f8051d18857cc4833ffec976fc99729e07c752 (patch)
tree3d1939abab5dac4222c6d59a5e4d377abe856b82
parentc9d6628503ef49fdc2e537f96c78c2d3174a0fe7 (diff)
Previous fix to allow '-' in filenames did not work as desired,
causes a trailing ' ' to be on filenames and was not recognized if at beginning of string. Fixed so those instances work also.
-rw-r--r--sys/arch/powerpc/stand/boot.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/arch/powerpc/stand/boot.c b/sys/arch/powerpc/stand/boot.c
index 85f4ceed6b2..d274c9a92be 100644
--- a/sys/arch/powerpc/stand/boot.c
+++ b/sys/arch/powerpc/stand/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.11 2000/01/22 03:27:52 rahnds Exp $ */
+/* $OpenBSD: boot.c,v 1.12 2000/01/24 03:07:54 rahnds Exp $ */
/* $NetBSD: boot.c,v 1.1 1997/04/16 20:29:17 thorpej Exp $ */
/*
@@ -104,10 +104,20 @@ parseargs(str, howtop)
if (str[0] == '\0') {
return;
}
- for (cp = &str[1]; *cp; cp++) {
- if (cp[-1] == ' ' && *cp == '-') {
+ cp = str;
+ while (*cp != 0) {
+ /* check for - */
+ if (*cp == '-') {
+ /* start of options found */
break;
}
+ while (*cp != 0 && *cp != ' ') {
+ /* character in the middle of the name, skip */
+ cp++;
+ }
+ while (*cp == ' ') {
+ *cp++ = 0;
+ }
}
if (!*cp)
return;