Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / File-lists.awk
diff options
context:
space:
mode:
1 files changed, 4 insertions, 2 deletions
-rw-r--r--awk-edits/File-lists.awk6
diff --git a/awk-edits/File-lists.awk b/awk-edits/File-lists.awk
index b18d634..4e387f3 100644
--- a/awk-edits/File-lists.awk
+++ b/awk-edits/File-lists.awk
@@ -110,7 +110,9 @@ BEGIN {
flname[9] = "ft-markdown"
flrepl[9] = "markdown.svg"
- for (i = 1; i <= length(flname); i++) {
+ flnamelength = 9 # POSIX compatibility: length(flname) is not valid
+
+ for (i = 1; i <= flnamelength; i++) {
flpat[i] = "&#38;&#38;" flname[i]
if (index(flname[i], "ft") == 1)
flrepl[i] = "<td><img class=\"file-icon unzoomable\" src=\"/img/" flrepl[i] "\"></td>"
@@ -153,7 +155,7 @@ function fileSubstitute(ind) {
}
/^[ \t]*(<p>|)&#38;&#38;/ {
- for (i = 1; i <= length(flname); i++) {
+ for (i = 1; i <= flnamelength; i++) {
if (index($0, flpat[i]) != 0)
fileSubstitute(i)
}