[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Numeric Assignment to $0 Requires Coercion.
From: |
arnold |
Subject: |
Re: [bug-gawk] Numeric Assignment to $0 Requires Coercion. |
Date: |
Tue, 31 Jul 2018 12:34:02 -0600 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi.
Ralph Corderoy <address@hidden> wrote:
> $ yes a b c | sed 5q | awk '{$2 = ++i} 1'
> a 1 c
> a 2 c
> a 3 c
> a 4 c
> a 5 c
> $ yes a b c | sed 5q | awk '{$0 = ++i} 1'
> [ nothing ]
Thanks for the report. The fix turned out to be fairly easy.
See the patch below. It will be in git shortly.
Thanks!
Arnold
--------------------------------
diff --git a/interpret.h b/interpret.h
index 8408a53..fed0078 100644
--- a/interpret.h
+++ b/interpret.h
@@ -46,6 +46,7 @@ unfield(NODE **l, NODE **r)
(*l) = dupnode(*r);
DEREF(*r);
}
+ force_string(*l);
}
#define UNFIELD(l, r) unfield(& (l), & (r))