/* 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;
cmd_execute (void)
{
lex_match_id ("EXECUTE");
- procedure (NULL, NULL, NULL);
+ procedure (NULL, NULL);
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)
{
- 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"))
{
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");
#ifdef unix