projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented the SHOW command and massaged the SET command to fit
[pspp-builds.git]
/
src
/
command.c
diff --git
a/src/command.c
b/src/command.c
index f86ef55c2be76f5fc351ff84b06a3ffb5de13732..163f9845742ee095096f8791c7d18d64d47f4a52 100644
(file)
--- a/
src/command.c
+++ b/
src/command.c
@@
-201,7
+201,8
@@
cmd_parse (void)
/* If we're in a FILE TYPE structure, only certain commands can be
allowed. */
/* If we're in a FILE TYPE structure, only certain commands can be
allowed. */
- if (pgm_state == STATE_INPUT && vfm_source == &file_type_source
+ if (pgm_state == STATE_INPUT
+ && case_source_is_class (vfm_source, &file_type_source_class)
&& !FILE_TYPE_okay (cp))
return CMD_FAILURE;
&& !FILE_TYPE_okay (cp))
return CMD_FAILURE;
@@
-561,28
+562,21
@@
int
cmd_execute (void)
{
lex_match_id ("EXECUTE");
cmd_execute (void)
{
lex_match_id ("EXECUTE");
- procedure (NULL, NULL
, NULL
);
+ procedure (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)
{
- assert_not_safer();
+ if ( safer_mode() )
+ {
+ msg (SE, _("This command not allowed when the SAFER option is set."));
+ return CMD_FAILURE;
+ }
+
lex_match_id ("ERASE");
if (!lex_force_match_id ("FILE"))
lex_match_id ("ERASE");
if (!lex_force_match_id ("FILE"))
@@
-601,7
+595,7
@@
cmd_erase (void)
return CMD_SUCCESS;
}
return CMD_SUCCESS;
}
-#if unix
+#if
def
unix
/* Spawn a shell process. */
static int
shell (void)
/* Spawn a shell process. */
static int
shell (void)
@@
-709,11
+703,15
@@
cmd_host (void)
{
int code;
{
int code;
- assert_not_safer();
-
+ if ( safer_mode() )
+ {
+ msg (SE, _("This command not allowed when the SAFER option is set."));
+ return CMD_FAILURE;
+ }
+
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 () == '.')