aboutsummaryrefslogtreecommitdiffstats
path: root/test/setrec1.awk
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2017-11-14 14:28:48 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2017-11-14 14:28:48 -0500
commit064d78b562c9670751c48673c6d1d171aff51a42 (patch)
tree8c50b4d4a4ba82be1a482ab3927dab6ded648fc7 /test/setrec1.awk
parentfe60f215f0dc446e39d69d4663cbb8c5ef406535 (diff)
downloadegawk-064d78b562c9670751c48673c6d1d171aff51a42.tar.gz
egawk-064d78b562c9670751c48673c6d1d171aff51a42.tar.bz2
egawk-064d78b562c9670751c48673c6d1d171aff51a42.zip
Fix field corruption when $0 is reassigned with open $n references.
Diffstat (limited to 'test/setrec1.awk')
-rw-r--r--test/setrec1.awk9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/setrec1.awk b/test/setrec1.awk
new file mode 100644
index 00000000..3da1aa10
--- /dev/null
+++ b/test/setrec1.awk
@@ -0,0 +1,9 @@
+function reassign(x, y) {
+ $0 = x
+ print y
+}
+
+BEGIN {
+ $0 = substr("geronimo", 5, 3)
+ reassign(" 52", $1)
+}