all repos — cgit @ e0572c39f78b4f88c706a49a60e211302b8e015c

a hyperfast web frontend for git written in c

Merge branch 'stable'

* stable:
  Fix segfault

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Lars Hjemli hjemli@gmail.com
Sat, 23 Feb 2008 20:13:57 +0100
commit

e0572c39f78b4f88c706a49a60e211302b8e015c

parent

e5ed227ef0da561e2bde8646ec816842392377ee

1 files changed, 5 insertions(+), 15 deletions(-)

jump to
M html.chtml.c

@@ -48,9 +48,7 @@ char *t = txt;

while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='&') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html("&gt;"); else if (c=='<')

@@ -71,9 +69,7 @@ char *t = txt;

while(t && *t && len--){ int c = *t; if (c=='<' || c=='>' || c=='&') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html("&gt;"); else if (c=='<')

@@ -84,12 +80,8 @@ txt = t+1;

} t++; } - if (t!=txt) { - char c = *t; - *t = '\0'; - html(txt); - *t = c; - } + if (t!=txt) + write(htmlfd, txt, t - txt); if (len<0) html("..."); }

@@ -100,9 +92,7 @@ char *t = txt;

while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='\'') { - *t = '\0'; - html(txt); - *t = c; + write(htmlfd, txt, t - txt); if (c=='>') html("&gt;"); else if (c=='<')