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 | 378cae639849ba9f020666d1cf6dad6e08bfaf0e (diff) |
Only show first 80 characters of commit subject in log and summary
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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) { |