diff options
author | Lars Hjemli | 2006-12-22 00:58:18 +0100 |
---|---|---|
committer | Lars Hjemli | 2006-12-22 00:58:18 +0100 |
commit | 9d8d9b61238df3a855504825e5f735d00289f12b (patch) | |
tree | ee4e5b6712abb684b920f1f69683eb2b43c6fd8d /html.c | |
parent | 378cae639849ba9f020666d1cf6dad6e08bfaf0e (diff) | |
download | cgit-9d8d9b61238df3a855504825e5f735d00289f12b.tar.gz cgit-9d8d9b61238df3a855504825e5f735d00289f12b.tar.bz2 cgit-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 'html.c')
-rw-r--r-- | html.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -65,6 +65,34 @@ void html_txt(char *txt) | |||
65 | html(txt); | 65 | html(txt); |
66 | } | 66 | } |
67 | 67 | ||
68 | void html_ntxt(int len, char *txt) | ||
69 | { | ||
70 | char *t = txt; | ||
71 | while(*t && len--){ | ||
72 | int c = *t; | ||
73 | if (c=='<' || c=='>' || c=='&') { | ||
74 | *t = '\0'; | ||
75 | html(txt); | ||
76 | *t = c; | ||
77 | if (c=='>') | ||
78 | html(">"); | ||
79 | else if (c=='<') | ||
80 | html("<"); | ||
81 | else if (c=='&') | ||
82 | html("&"); | ||
83 | txt = t+1; | ||
84 | } | ||
85 | t++; | ||
86 | } | ||
87 | if (t!=txt) { | ||
88 | char c = *t; | ||
89 | *t = '\0'; | ||
90 | html(txt); | ||
91 | *t = c; | ||
92 | } | ||
93 | if (len<0) | ||
94 | html("..."); | ||
95 | } | ||
68 | 96 | ||
69 | void html_attr(char *txt) | 97 | void html_attr(char *txt) |
70 | { | 98 | { |