From 09dc60b4d73f290ccad37a086a6f867fe11efa44 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Sun, 29 Jul 2018 06:16:42 +0100 Subject: patch and plain diff works --- ui_70-diff.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ui_70-diff.c') diff --git a/ui_70-diff.c b/ui_70-diff.c index 999c629..46e729d 100644 --- a/ui_70-diff.c +++ b/ui_70-diff.c @@ -381,9 +381,21 @@ void cgit_print_diff_ctrls(void) html(""); } -typedef struct strbuf* cgit_gopher_add_info_tag(struct diff_options *opt, void *data){ +struct strbuf* cgit_gopher_add_info_tag(struct diff_options *opt, void *data){ + struct strbuf* buff; + char *str; + + + buff = malloc(sizeof(struct strbuf)); + str = malloc(2 * sizeof(char)); + str[0]= 'i'; + str[1]= '\0'; + strbuf_init(buff, 2); + strbuf_attach(buff, str, 2, 2); + + return buff; } @@ -448,6 +460,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, diff_setup(&diffopt); diffopt.output_format = DIFF_FORMAT_PATCH; + /*diffopt.output_format = DIFF_FORMAT_RAW;*/ diffopt.flags.recursive = 1; diffopt.output_prefix=cgit_gopher_add_info_tag; diff_setup_done(&diffopt); -- cgit v1.2.3