diff options
author | Lars Hjemli <hjemli@gmail.com> | 2009-08-09 20:46:34 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-08-09 20:46:34 (JST) |
commit | db8b8cb9467625cb8d9ecb67863aa67590e59cc0 (patch) | |
tree | d27644fc1b98ec6365e74f3ba40c19f78f8a287f /ui-summary.c | |
parent | db6303b58883c4417f5bcc0c1ee34fed6553dca3 (diff) | |
parent | 537c05f138d59c1eb3ac8e2d8b0dca3a38aa5dd4 (diff) | |
download | cgit-db8b8cb9467625cb8d9ecb67863aa67590e59cc0.zip cgit-db8b8cb9467625cb8d9ecb67863aa67590e59cc0.tar.gz |
Merge branch 'lh/about'
Conflicts:
cgit.h
Diffstat (limited to 'ui-summary.c')
-rw-r--r-- | ui-summary.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/ui-summary.c b/ui-summary.c index ede4a62..a2c018e 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -66,11 +66,27 @@ void cgit_print_summary() | |||
66 | html("</table>"); | 66 | html("</table>"); |
67 | } | 67 | } |
68 | 68 | ||
69 | void cgit_print_repo_readme() | 69 | void cgit_print_repo_readme(char *path) |
70 | { | 70 | { |
71 | if (ctx.repo->readme) { | 71 | char *slash, *tmp; |
72 | html("<div id='summary'>"); | 72 | |
73 | html_include(ctx.repo->readme); | 73 | if (!ctx.repo->readme) |
74 | html("</div>"); | 74 | return; |
75 | } | 75 | |
76 | if (path) { | ||
77 | slash = strrchr(ctx.repo->readme, '/'); | ||
78 | if (!slash) | ||
79 | return; | ||
80 | tmp = xmalloc(slash - ctx.repo->readme + 1 + strlen(path) + 1); | ||
81 | strncpy(tmp, ctx.repo->readme, slash - ctx.repo->readme + 1); | ||
82 | strcpy(tmp + (slash - ctx.repo->readme + 1), path); | ||
83 | } else | ||
84 | tmp = ctx.repo->readme; | ||
85 | html("<div id='summary'>"); | ||
86 | if (ctx.repo->about_filter) | ||
87 | cgit_open_filter(ctx.repo->about_filter); | ||
88 | html_include(tmp); | ||
89 | if (ctx.repo->about_filter) | ||
90 | cgit_close_filter(ctx.repo->about_filter); | ||
91 | html("</div>"); | ||
76 | } | 92 | } |