From 9dbcde8882a8a917b6d0329e06ea2232e62b1c8c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 19 Jun 2017 21:20:03 -0700 Subject: awk macro: bugfix: non-use of redirection mode strings. The problem here is that ensure-stream ignores the mode argument and decides between "r" and "w". That is incorrect; the mode could be "a" for append. The second problem is that the ignored mode strings are also wrong. For an input pipe, "w" is specified rather than "r". * share/txr/stdlib/awk.tl (sys:awk-state ensure-stream): Use the mode argument. The cases consolidate, because all that need be distinguished here is file versus pipe. (sys:awk-mac-let): for the (path . body) ^(sys:awk-redir ,',aws-sym *stdout* :outp "w" ,path ,body)) (