diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-17 21:47:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-17 21:47:38 +0000 |
commit | 763c13431ae4a8559089dea9824624628852e400 (patch) | |
tree | 3e10214114f6beb4e3278bd395d382b3361ad02d /sys | |
parent | a55fef161900bf9068b3e6d3ae5f1cdf85133b8c (diff) |
make "boot> -a" work like "boot> bsd -a"; ie. flags shortcut
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/stand/boot/cmd.c | 12 | ||||
-rw-r--r-- | sys/stand/boot/cmd.c | 12 |
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/arch/i386/stand/boot/cmd.c b/sys/arch/i386/stand/boot/cmd.c index 16cedf159e8..92cab8def94 100644 --- a/sys/arch/i386/stand/boot/cmd.c +++ b/sys/arch/i386/stand/boot/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.8 1997/04/16 22:14:15 deraadt Exp $ */ +/* $OpenBSD: cmd.c,v 1.9 1997/04/17 21:47:37 deraadt Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -90,6 +90,7 @@ getcmd(cmd) cmd->argc = 1; if (!readline(cmd_buf, cmd->timeout)) { + printf("\n"); cmd->cmd = CMD_BOOT; cmd->argv[0] = cmd_table[CMD_BOOT].cmd_name; cmd->argv[1] = NULL; @@ -101,7 +102,6 @@ getcmd(cmd) for (q = cmd_buf; *q && (*q == ' ' || *q == '\t'); q++) ; p = nextword(q); -printf("cmd=%s\n", q); for (l = 0; q[l]; l++) ; @@ -111,15 +111,17 @@ printf("cmd=%s\n", q); if (ct->cmd_name == NULL) { cmd->cmd = CMD_BOOT; cmd->argv[0] = cmd_table[CMD_BOOT].cmd_name; - if (q && *q) + if (q && *q) { + if (*q == '-') + cmd->argv[cmd->argc++] = NULL; /* XXX */ cmd->argv[cmd->argc++] = q; + } } else { cmd->cmd = ct->cmd_id; cmd->argv[0] = ct->cmd_name; } while (p && cmd->argc+1 < sizeof(cmd->argv) / sizeof(cmd->argv[0])) { cmd->argv[cmd->argc++] = p; -printf("argN=%s\n", p); p = nextword(p); } cmd->argv[cmd->argc] = NULL; @@ -372,7 +374,7 @@ execmd(cmd) case CMD_BOOT: /* XXX "boot -s" will not work as this is written */ - if (cmd->argc > 1) { + if (cmd->argc > 1 && cmd->argv[1]) { char *p; for (p = cmd->argv[1]; *p; p++) diff --git a/sys/stand/boot/cmd.c b/sys/stand/boot/cmd.c index 16cedf159e8..92cab8def94 100644 --- a/sys/stand/boot/cmd.c +++ b/sys/stand/boot/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.8 1997/04/16 22:14:15 deraadt Exp $ */ +/* $OpenBSD: cmd.c,v 1.9 1997/04/17 21:47:37 deraadt Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -90,6 +90,7 @@ getcmd(cmd) cmd->argc = 1; if (!readline(cmd_buf, cmd->timeout)) { + printf("\n"); cmd->cmd = CMD_BOOT; cmd->argv[0] = cmd_table[CMD_BOOT].cmd_name; cmd->argv[1] = NULL; @@ -101,7 +102,6 @@ getcmd(cmd) for (q = cmd_buf; *q && (*q == ' ' || *q == '\t'); q++) ; p = nextword(q); -printf("cmd=%s\n", q); for (l = 0; q[l]; l++) ; @@ -111,15 +111,17 @@ printf("cmd=%s\n", q); if (ct->cmd_name == NULL) { cmd->cmd = CMD_BOOT; cmd->argv[0] = cmd_table[CMD_BOOT].cmd_name; - if (q && *q) + if (q && *q) { + if (*q == '-') + cmd->argv[cmd->argc++] = NULL; /* XXX */ cmd->argv[cmd->argc++] = q; + } } else { cmd->cmd = ct->cmd_id; cmd->argv[0] = ct->cmd_name; } while (p && cmd->argc+1 < sizeof(cmd->argv) / sizeof(cmd->argv[0])) { cmd->argv[cmd->argc++] = p; -printf("argN=%s\n", p); p = nextword(p); } cmd->argv[cmd->argc] = NULL; @@ -372,7 +374,7 @@ execmd(cmd) case CMD_BOOT: /* XXX "boot -s" will not work as this is written */ - if (cmd->argc > 1) { + if (cmd->argc > 1 && cmd->argv[1]) { char *p; for (p = cmd->argv[1]; *p; p++) |