X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fsave-translate.c;h=26941329f35ad378426ad441654031e9ab586791;hb=e441137bbe19f41edbc87dd51ecd2a8e4396cf6d;hp=6601f30b1833a3aa129fa5507b8f3ec24422a945;hpb=b3fcf4b1644bf4af9b5eb7b0b0f8856c51118128;p=pspp diff --git a/src/language/data-io/save-translate.c b/src/language/data-io/save-translate.c index 6601f30b18..26941329f3 100644 --- a/src/language/data-io/save-translate.c +++ b/src/language/data-io/save-translate.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2010, 2011, 2013 Free Software Foundation, Inc. + Copyright (C) 2010, 2011, 2013, 2016 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -86,8 +86,11 @@ cmd_save_translate (struct lexer *lexer, struct dataset *ds) stage = case_map_stage_create (dict); dict_delete_scratch_vars (dict); - while (lex_match (lexer, T_SLASH)) + while (lex_token (lexer) != T_ENDCMD) { + if (!lex_force_match (lexer, T_SLASH)) + goto error; + if (lex_match_id (lexer, "OUTFILE")) { if (handle != NULL) @@ -234,8 +237,6 @@ cmd_save_translate (struct lexer *lexer, struct dataset *ds) else if (!parse_dict_trim (lexer, dict)) goto error; } - if (lex_end_of_command (lexer) != CMD_SUCCESS) - goto error; if (type == 0) { @@ -247,10 +248,10 @@ cmd_save_translate (struct lexer *lexer, struct dataset *ds) lex_sbc_missing ("OUTFILE"); goto error; } - else if (!replace && fn_exists (fh_get_file_name (handle))) + else if (!replace && fn_exists (handle)) { - msg (SE, _("Output file `%s' exists but REPLACE was not specified."), - fh_get_file_name (handle)); + msg (SE, _("Output file `%s' exists but %s was not specified."), + fh_get_file_name (handle), "REPLACE"); goto error; }