diff options
-rw-r--r-- | render.awk | 14 | ||||
-rw-r--r-- | test/links.txt | 1 |
2 files changed, 13 insertions, 2 deletions
@@ -1,4 +1,11 @@ +function mylen(a){ + l=0; + for (d in a) + l+=1; + return l; +} + function info_line(name, sel, host, port, dst){ printf("[i|%s|%s|%s|%s]\r\n", name, sel, host, port) > dst; } @@ -10,7 +17,8 @@ function show_link(l, i, dst){ else{ printf("[1|%s|%s|%s|%s]\r\n", l[i,"LinkName"], l[i,"Selector"], l[i,"Host"], l[i,"Port"] ) > dst; split(l[i,"Description"], descr, "\n"); - for (d in descr){ + dl=mylen(descr); + for (d=1;d<=dl;d++){ info_line(descr[d],"Err", HOST, PORT, dst); } info_line("", "Err", HOST, PORT, dst); @@ -53,8 +61,10 @@ function category_in_parents(category, i){ function category_header(category, i, dst){ info_line(category[i,"Title"], "Err", HOST, PORT, dst); info_line("", "Err", HOST, PORT, dst); + delete descr split(category[i,"Description"], descr, "\n"); - for (d in descr){ + dl=mylen(descr); + for (d=1;d<=dl;d++){ info_line(descr[d], "Err", HOST, PORT, dst); } } diff --git a/test/links.txt b/test/links.txt index aab3021..44e39da 100644 --- a/test/links.txt +++ b/test/links.txt @@ -4,6 +4,7 @@ Host: sdf.org Port: 70 LinkName: Gopherholes at SDF.org Description: Discover a thousand personal gopherholes at SDF.org. + (Super Dimension Fortress) Category: homepage Keywords: homepage, sdf, freeshell |