diff --git a/ChangeLog b/ChangeLog index 60239f5..3106c92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-18 John Haque + * eval.c (r_interpret): In case Op_K_getline, skip after_assign + routine if there wasn't any assignment to the variable + for 'getline var'. + 2011-07-17 Arnold D. Robbins * main.c (varinit): Mark FPAT as NON_STANDARD. Thanks to diff --git a/eval.c b/eval.c index bdbd04b..52f7204 100644 --- a/eval.c +++ b/eval.c @@ -2458,7 +2458,20 @@ func_call: JUMPTO((pc + 1)->target_beginfile); } } while (r == NULL); /* EOF */ + PUSH(r); + + if (pc->into_var && r->numbr <= 0.0) { + /* There wasn't any assignment to the var or the FIELD; + * Don't run the after_assign routine. + */ + + ni = pc->nexti; + if (ni->opcode == Op_field_assign) + ni->field_assign = (Func_ptr) 0; + else if (ni->opcode == Op_var_assign) + ni->assign_var = (Func_ptr) 0; + } break; case Op_after_endfile: