summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-29 22:51:32 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-29 22:51:32 -0800
commit14611800d14b9d0a95a1c2110e704ecf3718b2a4 (patch)
tree963f2b0fde0afe0fa440a4085e3aefa8a1c5df93 /share
parent742f4908ae6b3f03930434594a56e5449e5fe4f2 (diff)
downloadtxr-14611800d14b9d0a95a1c2110e704ecf3718b2a4.tar.gz
txr-14611800d14b9d0a95a1c2110e704ecf3718b2a4.tar.bz2
txr-14611800d14b9d0a95a1c2110e704ecf3718b2a4.zip
bugfix: awk elides loop despite begin/end clauses.
* share/txr/stdlib/awk.tl (awk): The macro must not elide the processing loop if there are :begin-file, :end-file or :end actions. All these actions must be missing, not only the, cond-actions for that elision to be valid.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/awk.tl3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl
index 760c92ac..23db2403 100644
--- a/share/txr/stdlib/awk.tl
+++ b/share/txr/stdlib/awk.tl
@@ -331,7 +331,8 @@
p-actions-xform))))))
,*awc.begin-actions
(unwind-protect
- ,(if awc.cond-actions
+ ,(if (or awc.cond-actions awc.begin-file-actions
+ awc.end-file-actions awc.end-actions)
^(qref ,aws-sym (loop ,awk-fun
,(if awc.begin-file-actions
awk-begf-fun)