diff options
-rw-r--r-- | share/txr/stdlib/awk.tl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl index de6bcb71..e74a0a18 100644 --- a/share/txr/stdlib/awk.tl +++ b/share/txr/stdlib/awk.tl @@ -72,12 +72,13 @@ (when beg-file-func [beg-file-func aws]) (unwind-protect - (let ((recin (record-adapter (if (regexp aws.rs) - aws.rs - (regex-compile aws.rs)) - (if (streamp in) - in - (open-file in))))) + (let* ((stin (if (streamp in) in (open-file in))) + (recin (if (equal aws.rs "\n") + stin + (record-adapter (if (regexp aws.rs) + aws.rs + (regex-compile aws.rs)) + stin)))) (set aws.file-rec-num 0) (whilet ((rec (get-line recin))) (set aws.rec rec) |