aboutsummaryrefslogtreecommitdiffstats
path: root/com32/rosh
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2010-10-03 06:59:44 -0400
committerGene Cumm <gene.cumm@gmail.com>2010-10-09 07:33:07 -0400
commitf45d80d58bc5d5c7ba91fad33fa2dcb57fe333bc (patch)
tree9cf7b9b650f62e4a49b7161a624d571a5cdbc25c /com32/rosh
parentdbc91c69f13a2a120b9fbb8a7078347fc171850d (diff)
downloadsyslinux-f45d80d58bc5d5c7ba91fad33fa2dcb57fe333bc.tar.gz
syslinux-f45d80d58bc5d5c7ba91fad33fa2dcb57fe333bc.tar.xz
syslinux-f45d80d58bc5d5c7ba91fad33fa2dcb57fe333bc.zip
rosh: Change rosh_run() to use argc/argv
Diffstat (limited to 'com32/rosh')
-rw-r--r--com32/rosh/rosh.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c
index d6a3035e..7f08673d 100644
--- a/com32/rosh/rosh.c
+++ b/com32/rosh/rosh.c
@@ -1105,22 +1105,21 @@ void rosh_reboot(void)
} /* rosh_reboot */
/* Run a boot string, calling syslinux_run_command
- * cmdstr command string to process
+ * argc Argument count
+ * argv Argument values
*/
-void rosh_run(const char *cmdstr)
+void rosh_run(int argc, char *argv[])
{
- int cmdpos;
- char *cmdptr;
+ char cmdstr[ROSH_CMD_SZ];
+ int len;
- cmdpos = 0;
- ROSH_DEBUG("CMD: '%s'\n", cmdstr);
- /* skip the first word */
- cmdpos = rosh_search_sp(cmdstr, cmdpos);
- /* skip spaces */
- cmdpos = rosh_search_nonsp(cmdstr, cmdpos);
- cmdptr = (char *)(cmdstr + cmdpos);
- printf("--run: '%s'\n", cmdptr);
- syslinux_run_command(cmdptr);
+ len = rosh_argcat(cmdstr, argc, argv, 0);
+ if (len) {
+ printf("--run: '%s'\n", cmdstr);
+ syslinux_run_command(cmdstr);
+ } else {
+ printf(APP_NAME ":run: No arguments\n");
+ }
} /* rosh_run */
/* Process an argc/argv pair and call handling function
@@ -1276,7 +1275,7 @@ char rosh_command(int argc, char *argv[], const char *ipwdstr)
case 'u':
case 'U':
if (strncasecmp("run", argv[0], tlen) == 0)
- rosh_run(cmdstr);
+ rosh_run(argc - 1, &argv[1]);
else
rosh_help(1, NULL);
break;