# HG changeset patch # User jwe # Date 1017109386 0 # Node ID c21ae2c5840fb528e58681cc60998b16b8e930a6 # Parent 7200bfd25c97715c376df8ce28fb246a2af49467 [project @ 2002-03-26 02:23:06 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2002-03-25 John W. Eaton + + * parse.y (parse_fcn_file): Call error if there is no input file. + (parse_and_execute (FILE *): Protect get_input_from_eval_string. + Set get_input_from_eval_string to false before calling yyparse. + * lex.l (reset_parser): Also skip yyrestart (stdin) if + reading_script_file is true. + 2002-03-07 John W. Eaton * pt-loop.cc (evaluating_looping_command): New global. diff --git a/src/lex.l b/src/lex.l --- a/src/lex.l +++ b/src/lex.l @@ -783,7 +783,9 @@ // Only ask for input from stdin if we are expecting interactive // input. if ((interactive || forced_interactive) - && ! (reading_fcn_file || get_input_from_eval_string + && ! (reading_fcn_file + || reading_script_file + || get_input_from_eval_string || input_from_startup_file)) yyrestart (stdin); diff --git a/src/parse.y b/src/parse.y --- a/src/parse.y +++ b/src/parse.y @@ -2720,7 +2720,7 @@ parse_and_execute (FILE *f) { unwind_protect::begin_frame ("parse_and_execute"); - + YY_BUFFER_STATE old_buf = current_buffer (); YY_BUFFER_STATE new_buf = create_buffer (f); @@ -2731,9 +2731,11 @@ unwind_protect_bool (line_editing); unwind_protect_bool (input_from_command_line_file); + unwind_protect_bool (get_input_from_eval_string); line_editing = false; input_from_command_line_file = false; + get_input_from_eval_string = false; unwind_protect_ptr (curr_sym_tab); @@ -3200,6 +3202,8 @@ script_file_executed = true; } } + else + error ("no such file, `%s'", ff.c_str ()); unwind_protect::run_frame ("parse_fcn_file");