aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sade/dispatch.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2002-06-03 19:42:49 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2002-06-03 19:42:49 +0000
commite364f0da4284eac7b04d8764e44541d96106a0c1 (patch)
tree2666843aaf01668fd403104c4844c04ae756219e /usr.sbin/sade/dispatch.c
parent77218da3745466ee6373b8a8392437c61734e472 (diff)
Notes
Diffstat (limited to 'usr.sbin/sade/dispatch.c')
-rw-r--r--usr.sbin/sade/dispatch.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.sbin/sade/dispatch.c b/usr.sbin/sade/dispatch.c
index 2aa3fa962d71..357cd6031ac6 100644
--- a/usr.sbin/sade/dispatch.c
+++ b/usr.sbin/sade/dispatch.c
@@ -263,6 +263,13 @@ dispatchCommand(char *str)
msgNotify("Warning: No such command ``%s''", str);
i = DITEM_FAILURE;
}
+ /*
+ * Allow a user to prefix a command with "noError" to cause
+ * us to ignore any errors for that one command.
+ */
+ if (i != DITEM_SUCCESS && variable_get(VAR_NO_ERROR))
+ i = DITEM_SUCCESS;
+ variable_unset(VAR_NO_ERROR);
}
return i;
}
@@ -320,18 +327,10 @@ dispatch_execute(qelement *head)
item = (command_buffer *) head->q_forw;
if (DITEM_STATUS(dispatchCommand(item->string)) != DITEM_SUCCESS) {
- /*
- * Allow a user to prefix a command with "noError" to cause
- * us to ignore any errors for that one command.
- */
- if (variable_get(VAR_NO_ERROR))
- variable_unset(VAR_NO_ERROR);
- else {
- msgConfirm("Command `%s' failed - rest of script aborted.\n",
- item->string);
- result |= DITEM_FAILURE;
- break;
- }
+ msgConfirm("Command `%s' failed - rest of script aborted.\n",
+ item->string);
+ result |= DITEM_FAILURE;
+ break;
}
dispatch_free_command(item);
}