summaryrefslogtreecommitdiffstats
path: root/stdlib/awk.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-23 21:44:10 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-23 21:44:10 -0700
commit41263c972c2d2892f9bb65e439f1b744a26a271f (patch)
tree4973a7ef3f666c89deb0c9c198fe994db4c4df20 /stdlib/awk.tl
parent55e6eff5b6127e3528b29ebfd1d679f7158747c4 (diff)
downloadtxr-41263c972c2d2892f9bb65e439f1b744a26a271f.tar.gz
txr-41263c972c2d2892f9bb65e439f1b744a26a271f.tar.bz2
txr-41263c972c2d2892f9bb65e439f1b744a26a271f.zip
awk: bug: broken redirection operators.
* stdlib/awk.tl (sys:awk-redir): Fix regression from April 2018. The gensym variable introduced must be parallel bound, since it is referenced by the init expression of the other variable. This breaks all awk redirection operators.
Diffstat (limited to 'stdlib/awk.tl')
-rw-r--r--stdlib/awk.tl4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib/awk.tl b/stdlib/awk.tl
index 54d2909c..d82ab8c3 100644
--- a/stdlib/awk.tl
+++ b/stdlib/awk.tl
@@ -289,8 +289,8 @@
(defmacro sys:awk-redir (aws-sym stream-var kind mode path body)
(with-gensyms (res-sym)
- ^(let ((,res-sym ,path)
- (,stream-var (qref ,aws-sym (ensure-stream ,kind ,res-sym ,mode))))
+ ^(let* ((,res-sym ,path)
+ (,stream-var (qref ,aws-sym (ensure-stream ,kind ,res-sym ,mode))))
,(if body
^(qref ,aws-sym (close-or-flush ,stream-var ,kind ,res-sym
(progn ,*body)))