about summary refs log tree commit diff
path: root/ui-summary.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-summary.c')
-rw-r--r--ui-summary.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/ui-summary.c b/ui-summary.c
index ede4a62..f2a9b46 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -66,11 +66,23 @@ void cgit_print_summary()
 	html("</table>");
 }
 
-void cgit_print_repo_readme()
+void cgit_print_repo_readme(char *path)
 {
-	if (ctx.repo->readme) {
-		html("<div id='summary'>");
-		html_include(ctx.repo->readme);
-		html("</div>");
-	}
+	char *slash, *tmp;
+
+	if (!ctx.repo->readme)
+		return;
+
+	if (path) {
+		slash = strrchr(ctx.repo->readme, '/');
+		if (!slash)
+			return;
+		tmp = xmalloc(slash - ctx.repo->readme + 1 + strlen(path) + 1);
+		strncpy(tmp, ctx.repo->readme, slash - ctx.repo->readme + 1);
+		strcpy(tmp + (slash - ctx.repo->readme + 1), path);
+	} else
+		tmp = ctx.repo->readme;
+	html("<div id='summary'>");
+	html_include(tmp);
+	html("</div>");
 }
t.3June McEnroe 2018-11-13Add gztell(3) to gzseek.3June McEnroe 2018-11-13Add gzseek.3June McEnroe 2018-11-13Add gzflush.3June McEnroe 2018-11-13Fix spacing after parenthetical sentencesJune McEnroe 2018-11-13Add gzungetc.3June McEnroe 2018-11-13Add gzgetc.3June McEnroe 2018-11-13Add gzputc.3June McEnroe 2018-11-13Add gzgets.3June McEnroe 2018-11-13Add gzputs.3June McEnroe 2018-11-13Add gzprintf.3June McEnroe 2018-11-13Add gzfwrite.3June McEnroe 2018-11-13Add gzwrite.3June McEnroe 2018-11-12Add gzfread.3June McEnroe 2018-11-12Add gzread.3June McEnroe 2018-11-12Add gzsetparams.3June McEnroe 2018-11-12Add gzbuffer.3June McEnroe 2018-11-12Add gzdopen to gzopen.3June McEnroe 2018-11-12Add gzopen.3June McEnroe 2018-11-12Add inflateBackEnd.3June McEnroe 2018-11-12Add inflateBack.3June McEnroe 2018-11-12Add inflateBackInit.3June McEnroe 2018-11-11Add inflateGetHeader.3June McEnroe 2018-11-11Add inflateMark.3June McEnroe 2018-11-11Add inflatePrime.3June McEnroe 2018-11-11Add inflateReset.3June McEnroe 2018-11-11Add inflateCopy.3June McEnroe 2018-11-11Add inflateSync.3June McEnroe 2018-11-11Add inflateGetDictionary.3June McEnroe 2018-11-11Add inflateSetDictionary.3June McEnroe 2018-11-11Add inflateInit2.3June McEnroe