aboutsummaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorGravatar Lars Hjemli <hjemli@gmail.com>2006-12-22 08:58:18 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2006-12-22 08:58:18 (JST)
commit9d8d9b61238df3a855504825e5f735d00289f12b (patch)
treeee4e5b6712abb684b920f1f69683eb2b43c6fd8d /html.c
parent378cae639849ba9f020666d1cf6dad6e08bfaf0e (diff)
downloadcgit-9d8d9b61238df3a855504825e5f735d00289f12b.zip
cgit-9d8d9b61238df3a855504825e5f735d00289f12b.tar.gz
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.c28
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)
65 html(txt); 65 html(txt);
66} 66}
67 67
68void 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("&gt;");
79 else if (c=='<')
80 html("&lt;");
81 else if (c=='&')
82 html("&amp;");
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
69void html_attr(char *txt) 97void html_attr(char *txt)
70{ 98{