diff options
author | Lars Hjemli <hjemli@gmail.com> | 2006-12-22 00:58:18 +0100 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2006-12-22 00:58:18 +0100 |
commit | 9d8d9b61238df3a855504825e5f735d00289f12b (patch) | |
tree | ee4e5b6712abb684b920f1f69683eb2b43c6fd8d /html.c | |
parent | Add missing ttl-options in config (diff) | |
download | cgit-pink-9d8d9b61238df3a855504825e5f735d00289f12b.tar.gz cgit-pink-9d8d9b61238df3a855504825e5f735d00289f12b.zip |
Only show first 80 characters of commit subject in log and summary
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | html.c | 28 |
1 files changed, 28 insertions, 0 deletions
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) { |