X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fcommand.c;h=c6d7659d09c1c34632487b1df8142c211e508171;hb=f3cf52b51e6d89e94190de22b1fa813e8d3746f7;hp=3185446789b5073ae0b225ce2bdd855152214e3e;hpb=317e6b778833b5dcd5dd195c0b677835a8024b2a;p=pspp diff --git a/src/command.c b/src/command.c index 3185446789..c6d7659d09 100644 --- a/src/command.c +++ b/src/command.c @@ -28,7 +28,7 @@ #include "dictionary.h" #include "error.h" #include "glob.h" -#include "getline.h" +#include "getl.h" #include "lexer.h" #include "main.h" #include "settings.h" @@ -45,6 +45,10 @@ #if HAVE_SYS_WAIT_H #include #endif + +#include "gettext.h" +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid /* Global variables. */ @@ -104,7 +108,7 @@ pspp_completion_function (const char *text, int state) cmd = &commands[state + skip]; - if ( cmd->transition[pgm_state] == STATE_ERROR || ( cmd->debug && ! test_mode ) ) + if ( cmd->transition[pgm_state] == STATE_ERROR || ( cmd->debug && ! get_testing_mode () ) ) { skip++; continue; @@ -305,7 +309,7 @@ static const char * find_word (const char *string, size_t *word_len) { /* Skip whitespace and asterisks. */ - while (isspace (*string)) + while (isspace ((unsigned char) *string)) string++; /* End of string? */ @@ -550,7 +554,7 @@ parse_command_name (void) { if (command->skip_entire_name) lex_get (); - if ( command->debug & !test_mode ) + if ( command->debug & !get_testing_mode () ) goto error; free_words (words, word_cnt); return command; @@ -595,7 +599,7 @@ parse_command_name (void) free (words[word_cnt]); } - if ( command->debug && !test_mode ) + if ( command->debug && !get_testing_mode () ) goto error; free_words (words, word_cnt); @@ -675,7 +679,7 @@ cmd_execute (void) int cmd_erase (void) { - if ( safer_mode() ) + if (get_safer_mode ()) { msg (SE, _("This command not allowed when the SAFER option is set.")); return CMD_FAILURE; @@ -735,7 +739,7 @@ shell (void) execl (shell_fn, shell_process, NULL); - err_hcf (1); + _exit (1); } case -1: @@ -806,7 +810,7 @@ cmd_host (void) { int code; - if ( safer_mode() ) + if (get_safer_mode ()) { msg (SE, _("This command not allowed when the SAFER option is set.")); return CMD_FAILURE;