projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added Levene test. Added T-TEST section to pspp.texi
[pspp-builds.git]
/
src
/
command.c
diff --git
a/src/command.c
b/src/command.c
index 7e9bb7742b7fba2f76dc4769d0c14e57594ad1f1..b386317a2c1052f07617f51f48ef022328b73339 100644
(file)
--- a/
src/command.c
+++ b/
src/command.c
@@
-249,7
+249,7
@@
cmd_parse (void)
/* Perform the state transition if the command completed
successfully (at least in part). */
/* Perform the state transition if the command completed
successfully (at least in part). */
- if (result !=
0
)
+ if (result !=
CMD_FAILURE
)
{
pgm_state = cp->transition[pgm_state];
{
pgm_state = cp->transition[pgm_state];
@@
-561,19
+561,28
@@
int
cmd_execute (void)
{
lex_match_id ("EXECUTE");
cmd_execute (void)
{
lex_match_id ("EXECUTE");
- procedure (NULL, NULL, NULL);
+ procedure (NULL, NULL, NULL
, NULL
);
return lex_end_of_command ();
}
return lex_end_of_command ();
}
+
+#define assert_not_safer() \
+ do { \
+ if (set_safer) \
+ { \
+ msg (SE, _("This command not allowed when the SAFER option is set.")); \
+ return CMD_FAILURE; \
+ } \
+} while(0)
+
+
+
/* Parses, performs the ERASE command. */
int
cmd_erase (void)
{
/* Parses, performs the ERASE command. */
int
cmd_erase (void)
{
- if (set_safer)
- {
- msg (SE, _("This command not allowed when the SAFER option is set."));
- return CMD_FAILURE;
- }
+
+ assert_not_safer();
lex_match_id ("ERASE");
if (!lex_force_match_id ("FILE"))
lex_match_id ("ERASE");
if (!lex_force_match_id ("FILE"))
@@
-589,10
+598,10
@@
cmd_erase (void)
return CMD_FAILURE;
}
return CMD_FAILURE;
}
- return
lex_end_of_command ()
;
+ return
CMD_SUCCESS
;
}
}
-#if unix
+#if
def
unix
/* Spawn a shell process. */
static int
shell (void)
/* Spawn a shell process. */
static int
shell (void)
@@
-700,15
+709,11
@@
cmd_host (void)
{
int code;
{
int code;
- if (set_safer)
- {
- msg (SE, _("This command not allowed when the SAFER option is set."));
- return CMD_FAILURE;
- }
+ assert_not_safer();
lex_match_id ("HOST");
lex_match_id ("HOST");
-#if unix
+#if
def
unix
/* Figure out whether to invoke an interactive shell or to execute a
single shell command. */
if (lex_look_ahead () == '.')
/* Figure out whether to invoke an interactive shell or to execute a
single shell command. */
if (lex_look_ahead () == '.')