src/c2html.c

changeset 27
53fd8595378c
parent 25
f82aa7afe872
child 30
0bfd4d6f086a
     1.1 --- a/src/c2html.c	Tue Apr 21 09:53:01 2015 +0200
     1.2 +++ b/src/c2html.c	Tue Apr 21 10:11:37 2015 +0200
     1.3 @@ -168,10 +168,16 @@
     1.4          // write line number
     1.5          if (showln) {
     1.6              WRITECONST(stream, out, "<span class=\"c2html-lineno\">");
     1.7 -            char lnbuf[16];
     1.8 -            int len = snprintf(lnbuf, 16, "%*d ", lnw, i+1);
     1.9 +            char lnbuf[128];
    1.10 +            int len;
    1.11 +            // line number link
    1.12 +            len = snprintf(lnbuf, 128, "<a name=\"l%d\" href=\"#l%d\">",
    1.13 +                i+1, i+1);
    1.14              out(lnbuf, 1, len, stream);
    1.15 -            WRITECONST(stream, out, "</span> ");
    1.16 +            // justified line number
    1.17 +            len = snprintf(lnbuf, 128, "%*d ", lnw, i+1);
    1.18 +            out(lnbuf, 1, len, stream);
    1.19 +            WRITECONST(stream, out, "</a></span> ");
    1.20          }
    1.21          
    1.22          // write formated (or plain) code line

mercurial