summaryrefslogtreecommitdiff
path: root/builtins/evalstring.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2014-01-29 17:00:07 -0500
committerChet Ramey <chet.ramey@case.edu>2014-01-29 17:00:07 -0500
commitb6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc (patch)
tree00fdd9c37c261d89c994fc1856252df719afec3a /builtins/evalstring.c
parent8581f42df9a1b1d848e2d4bdf3cc951b8d14b5be (diff)
downloadbash-4.3-testing.tar.gz
bash-4.3-rc2 overlaybash-4.3-rc2bash-4.3-testing
Diffstat (limited to 'builtins/evalstring.c')
-rw-r--r--builtins/evalstring.c12
1 files changed, 11 insertions, 1 deletions
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;