summaryrefslogtreecommitdiff
path: root/release/sysinstall/command.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-05-18 09:02:06 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-05-18 09:02:06 +0000
commit4d7b3c6f969f740c46dba429facb2f8287094724 (patch)
tree17c4597a102f39b64dd8bfa5d02904dde31d810b /release/sysinstall/command.c
parent0e5b52868f31dabc555eb35038e1b6b20a974da5 (diff)
Notes
Diffstat (limited to 'release/sysinstall/command.c')
-rw-r--r--release/sysinstall/command.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/release/sysinstall/command.c b/release/sysinstall/command.c
index ee7ce78d24a7..ff29b4e68b57 100644
--- a/release/sysinstall/command.c
+++ b/release/sysinstall/command.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: command.c,v 1.4 1995/05/16 11:37:07 jkh Exp $
+ * $Id: command.c,v 1.5 1995/05/18 02:42:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -137,7 +137,8 @@ command_func_add(char *key, commandFunc func, void *data)
strcpy(commandStack[numCommands]->key, key);
commandStack[numCommands]->ncmds = 1;
commandStack[numCommands]->cmds[0].type = CMD_FUNCTION;
- commandStack[numCommands++]->cmds[0].ptr = (void *)func;
+ commandStack[numCommands]->cmds[0].ptr = (void *)func;
+ commandStack[numCommands++]->cmds[0].data = data;
}
/* arg to sort */
@@ -164,20 +165,16 @@ command_execute(void)
for (j = 0; j < commandStack[i]->ncmds; j++) {
/* If it's a shell command, run system on it */
if (commandStack[i]->cmds[j].type == CMD_SHELL) {
- msgNotify("Executing command: %s",
- commandStack[i]->cmds[j].ptr);
+ msgNotify("Executing command: %s", commandStack[i]->cmds[j].ptr);
ret = vsystem((char *)commandStack[i]->cmds[j].ptr);
- msgDebug("Command `%s' returns status %d\n",
- commandStack[i]->cmds[j].ptr, ret);
+ msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
}
else {
/* It's a function pointer - call it with the key and the data */
func = (commandFunc)commandStack[i]->cmds[j].ptr;
msgNotify("Executing internal command @ %0x", func);
- ret = (*func)(commandStack[i]->key,
- commandStack[i]->cmds[j].data);
- msgDebug("Function @ %x returns status %d\n",
- commandStack[i]->cmds[j].ptr, ret);
+ ret = (*func)(commandStack[i]->key, commandStack[i]->cmds[j].data);
+ msgDebug("Function @ %x returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
}
}
}