Skip leading dash in kernel boot options instead of complaining it is an
authormiod <miod@openbsd.org>
Mon, 14 Aug 2023 13:49:42 +0000 (13:49 +0000)
committermiod <miod@openbsd.org>
Mon, 14 Aug 2023 13:49:42 +0000 (13:49 +0000)
unknown option character.

sys/arch/riscv64/riscv64/machdep.c

index 6220cbe..b684371 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: machdep.c,v 1.31 2023/08/05 05:45:52 guenther Exp $   */
+/*     $OpenBSD: machdep.c,v 1.32 2023/08/14 13:49:42 miod Exp $       */
 
 /*
  * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
@@ -871,7 +871,7 @@ process_kernel_args(void)
                if (*cp++ == '\0')
                        return;
 
-       while (*cp != 0) {
+       while (*++cp != 0) {
                switch (*cp) {
                case 'a':
                        boothowto |= RB_ASKNAME;
@@ -889,7 +889,6 @@ process_kernel_args(void)
                        printf("unknown option `%c'\n", *cp);
                        break;
                }
-               cp++;
        }
 }