aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2013-07-02 20:45:46 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2013-07-02 20:45:46 -0400
commit9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20 (patch)
treeb51848f2af88f781a920b75ff6aca4efe815bdda /awkgram.y
parentf0391b8a4db649853ecc47a10b09d7c4b04330cf (diff)
downloadegawk-9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20.tar.gz
egawk-9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20.tar.bz2
egawk-9ee8aeb59ad3b3873d52f3c9a2ab80b28c4c2c20.zip
After the gawkapi get_file function opens a file, call the BEGINFILE block.
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/awkgram.y b/awkgram.y
index f0ff4f0c..ab813543 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -145,6 +145,7 @@ static INSTRUCTION *ip_atexit = NULL;
static INSTRUCTION *ip_end;
static INSTRUCTION *ip_endfile;
static INSTRUCTION *ip_beginfile;
+INSTRUCTION *main_beginfile;
static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
@@ -2271,7 +2272,7 @@ parse_program(INSTRUCTION **pcode)
ip_newfile = ip_rec = ip_atexit = ip_beginfile = ip_endfile = NULL;
else {
ip_endfile = instruction(Op_no_op);
- ip_beginfile = instruction(Op_no_op);
+ main_beginfile = ip_beginfile = instruction(Op_no_op);
ip_rec = instruction(Op_get_record); /* target for `next', also ip_newfile */
ip_newfile = bcalloc(Op_newfile, 2, 0); /* target for `nextfile' */
ip_newfile->target_jmp = ip_end;