From b6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Wed, 29 Jan 2014 17:00:07 -0500 Subject: bash-4.3-rc2 overlay --- builtins/evalstring.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'builtins/evalstring.c') diff --git a/builtins/evalstring.c b/builtins/evalstring.c index a78688cc..671ab5d7 100644 --- a/builtins/evalstring.c +++ b/builtins/evalstring.c @@ -159,6 +159,9 @@ parse_prologue (string, flags, tag) } add_unwind_protect (pop_stream, (char *)NULL); + if (parser_expanding_alias ()) + add_unwind_protect (parser_restore_alias, (char *)NULL); + if (orig_string && ((flags & SEVAL_NOFREE) == 0)) add_unwind_protect (xfree, orig_string); end_unwind_frame (); @@ -211,6 +214,10 @@ parse_and_execute (string, from_file, flags) before executing the next command (resetting the line number sets it to 0; the first line number is 1). */ push_stream (lreset); + if (parser_expanding_alias ()) + /* push current shell_input_line */ + parser_save_alias (); + if (lreset == 0) line_number--; @@ -432,7 +439,10 @@ parse_string (string, from_file, flags, endp) before executing the next command (resetting the line number sets it to 0; the first line number is 1). */ push_stream (0); - + if (parser_expanding_alias ()) + /* push current shell_input_line */ + parser_save_alias (); + code = should_jump_to_top_level = 0; oglobal = global_command; ostring = string; -- cgit v1.2.1