Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit044e4f1eef1c70fb0b20aea435ef5513de0becf0 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-11-15 11:42:56 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-11-15 11:42:56 +0200
Files75e69ca98e74cc709ad10adfa8bbbe88504cdf0f
syndamia.com-044e4f1eef1c70fb0b20aea435ef5513de0becf0.tar
syndamia.com-044e4f1eef1c70fb0b20aea435ef5513de0becf0.tar.gz
syndamia.com-044e4f1eef1c70fb0b20aea435ef5513de0becf0.zip
Parenta13dd31583d37ab4c45a49cf7284fc22d9e63e2d (diff)
fix(meta.awk): Split code onto multiple files to work around a bug in nawk
1 files changed, 8 insertions, 1 deletions
-rw-r--r--meta/meta.awk9
diff --git a/meta/meta.awk b/meta/meta.awk
index f5c3c15..58603d2 100644
--- a/meta/meta.awk
+++ b/meta/meta.awk
@@ -31,7 +31,14 @@ BEGIN {
sub(/html$/, "du", FILENAME)
gsub(/\$DUNBAR_SOURCE/, "/" FILENAME, end)
- print start getfile(ARGV[i]) end > ARGV[i]
+ # Note: nawk (20250116) has what is probably a bug,
+ # if you do "print getfile(f) > f", you'll crash.
+ # This is probably because in getfile we close the
+ # file, but after the function is finished, the > expects
+ # the file to be opened (> probably opens the file before
+ # evaluating the print).
+ contents = start getfile(ARGV[i]) end
+ print contents > ARGV[i]
#-- Add to sitemap --#
print "<url><loc>" ENVIRON["URL"] substr(ARGV[i], length(ENVIRON["DST"]) + 1) "</loc><lastmod>" date "</lastmod><priority>1.0</priority></url>" > sitemap