X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcommand.c;h=316868a2be5d5663ffb72ba4745144b62e8ea694;hb=2ca4a5735ccbbe66ae2277faf6aa47e2bb83bfab;hp=2c62d2f26d79200b8dce23cc80b79dea24820cb1;hpb=1dc8717737084b93af2cd212e84edbd2cce1046c;p=pspp diff --git a/src/command.c b/src/command.c index 2c62d2f26d..316868a2be 100644 --- 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 (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; @@ -249,7 +250,7 @@ cmd_parse (void) /* 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]; @@ -561,11 +562,10 @@ int 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) \ @@ -575,8 +575,6 @@ cmd_execute (void) } \ } while(0) - - /* Parses, performs the ERASE command. */ int cmd_erase (void) @@ -601,7 +599,7 @@ cmd_erase (void) return CMD_SUCCESS; } -#if unix +#ifdef unix /* Spawn a shell process. */ static int shell (void) @@ -713,7 +711,7 @@ cmd_host (void) lex_match_id ("HOST"); -#if unix +#ifdef unix /* Figure out whether to invoke an interactive shell or to execute a single shell command. */ if (lex_look_ahead () == '.')