From 9d8d9b61238df3a855504825e5f735d00289f12b Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 22 Dec 2006 00:58:18 +0100 Subject: Only show first 80 characters of commit subject in log and summary Signed-off-by: Lars Hjemli --- html.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'html.c') diff --git a/html.c b/html.c index 8a69659..957b326 100644 --- a/html.c +++ b/html.c @@ -65,6 +65,34 @@ void html_txt(char *txt) html(txt); } +void html_ntxt(int len, char *txt) +{ + char *t = txt; + while(*t && len--){ + int c = *t; + if (c=='<' || c=='>' || c=='&') { + *t = '\0'; + html(txt); + *t = c; + if (c=='>') + html(">"); + else if (c=='<') + html("<"); + else if (c=='&') + html("&"); + txt = t+1; + } + t++; + } + if (t!=txt) { + char c = *t; + *t = '\0'; + html(txt); + *t = c; + } + if (len<0) + html("..."); +} void html_attr(char *txt) { -- cgit v1.2.3-24-g4f1b