Deleted Added
full compact
command.c (50479) command.c (79304)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
7 * $FreeBSD: head/usr.sbin/sade/command.c 50479 1999-08-28 01:35:59Z peter $
7 * $FreeBSD: head/usr.sbin/sade/command.c 79304 2001-07-05 09:51:09Z kris $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 140 unchanged lines hidden (view full) ---

156 int i, j, ret;
157 commandFunc func;
158
159 for (i = 0; i < numCommands; i++) {
160 for (j = 0; j < commandStack[i]->ncmds; j++) {
161 /* If it's a shell command, run system on it */
162 if (commandStack[i]->cmds[j].type == CMD_SHELL) {
163 msgNotify("Doing %s", commandStack[i]->cmds[j].ptr);
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 140 unchanged lines hidden (view full) ---

156 int i, j, ret;
157 commandFunc func;
158
159 for (i = 0; i < numCommands; i++) {
160 for (j = 0; j < commandStack[i]->ncmds; j++) {
161 /* If it's a shell command, run system on it */
162 if (commandStack[i]->cmds[j].type == CMD_SHELL) {
163 msgNotify("Doing %s", commandStack[i]->cmds[j].ptr);
164 ret = vsystem((char *)commandStack[i]->cmds[j].ptr);
164 ret = vsystem("%s", (char *)commandStack[i]->cmds[j].ptr);
165 if (isDebug())
166 msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
167 }
168 else {
169 /* It's a function pointer - call it with the key and the data */
170 func = (commandFunc)commandStack[i]->cmds[j].ptr;
171 if (isDebug())
172 msgDebug("%x: Execute(%s, %s)", func, commandStack[i]->key, commandStack[i]->cmds[j].data);
173 ret = (*func)(commandStack[i]->key, commandStack[i]->cmds[j].data);
174 if (isDebug())
175 msgDebug("Function @ %x returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
176 }
177 }
178 }
179}
165 if (isDebug())
166 msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
167 }
168 else {
169 /* It's a function pointer - call it with the key and the data */
170 func = (commandFunc)commandStack[i]->cmds[j].ptr;
171 if (isDebug())
172 msgDebug("%x: Execute(%s, %s)", func, commandStack[i]->key, commandStack[i]->cmds[j].data);
173 ret = (*func)(commandStack[i]->key, commandStack[i]->cmds[j].data);
174 if (isDebug())
175 msgDebug("Function @ %x returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
176 }
177 }
178 }
179}