-rw-r--r-- | ui-summary.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/ui-summary.c b/ui-summary.c index ede4a62..a2c018e 100644 --- a/ui-summary.c +++ b/ui-summary.c | |||
@@ -67,10 +67,26 @@ void cgit_print_summary() | |||
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 | |||
73 | if (!ctx.repo->readme) | ||
74 | return; | ||
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; | ||
72 | html("<div id='summary'>"); | 85 | html("<div id='summary'>"); |
73 | html_include(ctx.repo->readme); | 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); | ||
74 | html("</div>"); | 91 | html("</div>"); |
75 | } | 92 | } |
76 | } | ||