home readme diff tree note docs

0commit bc967d56eb4392cd95fdd2a84bc537c6e4be7826
1Author: lakefox <mason@lakefox.net>
2Date:   Fri Jan 23 11:47:13 2026 -0700
3
4    Added line numbers
5
6diff --git a/cgi-bin/git.awk b/cgi-bin/git.awk
7index a19177b..4969a24 100755
8--- a/cgi-bin/git.awk
9+++ b/cgi-bin/git.awk
10@@ -1,7 +1,6 @@
11 #!/bin/awk -f
12 
13 # /var/git
14-# Requires mandoc, git
15 
16 BEGIN {
17         split(ENVIRON["QUERY_STRING"], pairs, "&")
18@@ -82,8 +81,10 @@ BEGIN {
19                                 }
20                         }
21                 } else {
22+                        counter = 0
23                         while (cmd | getline line) {
24-                                print escape_html(line)
25+                                print "<span id='" counter "'><a href='#" counter "' style='user-select:none;'>" counter "</a></span>" escape_html(line)
26+                                counter += 1
27                         }
28                 }
29                 close(cmd)
30@@ -137,9 +138,11 @@ BEGIN {
31                         cmd = "git --git-dir=/var/git/" name ".git/ show " hash ":docs/" path " | mandoc -O width=120";
32                     
33                         print "<pre><code>"
34+                        print "test" > "/test.txt"
35                         while ((cmd | getline) > 0) {
36-				gsub(/.\010/, "", $0);
37+gsub(/.\010/, "", $0);
38                                 print escape_html($0);
39+                                print escape_html($0) >> "/test.txt"
40                         }
41                         print "</code></pre>"   
42 
43@@ -161,3 +164,4 @@ function escape_html(str) {
44     gsub(/'/, "\\&#39;", str)
45     return str
46 }
47+