aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/awkgram.y b/awkgram.y
index 720efcee..9f2b4d3c 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1190,8 +1190,10 @@ simple_stmt
*/
regular_print:
if ($4 == NULL) { /* no redirection */
- if ($3 == NULL) { /* printf without arg */
+ if ($3 == NULL) { /* print/printf without arg */
$1->expr_count = 0;
+ if ($1->opcode == Op_K_print)
+ $1->opcode = Op_K_print_rec;
$1->redir_type = redirect_none;
$$ = list_create($1);
} else {
@@ -1208,6 +1210,8 @@ regular_print:
bcfree(ip);
if ($3 == NULL) {
$1->expr_count = 0;
+ if ($1->opcode == Op_K_print)
+ $1->opcode = Op_K_print_rec;
$$ = list_append($4, $1);
} else {
INSTRUCTION *t = $3;