Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -48,7 +48,9 @@ void html_txt(char *txt) while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='&') { - write(htmlfd, txt, t - txt); + *t = '\0'; + html(txt); + *t = c; if (c=='>') html(">"); else if (c=='<') @@ -69,7 +71,9 @@ void html_ntxt(int len, char *txt) while(t && *t && len--){ int c = *t; if (c=='<' || c=='>' || c=='&') { - write(htmlfd, txt, t - txt); + *t = '\0'; + html(txt); + *t = c; if (c=='>') html(">"); else if (c=='<') @@ -80,8 +84,12 @@ void html_ntxt(int len, char *txt) } t++; } - if (t!=txt) - write(htmlfd, txt, t - txt); + if (t!=txt) { + char c = *t; + *t = '\0'; + html(txt); + *t = c; + } if (len<0) html("..."); } @@ -92,7 +100,9 @@ void html_attr(char *txt) while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='\'') { - write(htmlfd, txt, t - txt); + *t = '\0'; + html(txt); + *t = c; if (c=='>') html(">"); else if (c=='<') |