diff options
-rw-r--r-- | ui-ssdiff.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-ssdiff.c b/ui-ssdiff.c index 2146c71..d183d40 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c | |||
@@ -230,11 +230,13 @@ static void print_ssdiff_line(char *class, | |||
230 | struct diff_filespec *old_file = cgit_get_current_old_file(); | 230 | struct diff_filespec *old_file = cgit_get_current_old_file(); |
231 | char *lineno_str = fmt("n%d", old_line_no); | 231 | char *lineno_str = fmt("n%d", old_line_no); |
232 | char *id_str = fmt("id=%s#%s", is_null_sha1(old_file->sha1)?"HEAD":sha1_to_hex(old_rev_sha1), lineno_str); | 232 | char *id_str = fmt("id=%s#%s", is_null_sha1(old_file->sha1)?"HEAD":sha1_to_hex(old_rev_sha1), lineno_str); |
233 | char *fileurl = cgit_fileurl(ctx.repo->url, "tree", old_file->path, id_str); | ||
233 | html("<td class='lineno'><a href='"); | 234 | html("<td class='lineno'><a href='"); |
234 | html(cgit_fileurl(ctx.repo->url, "tree", old_file->path, id_str)); | 235 | html(fileurl); |
235 | htmlf("' id='%s'>%s</a>", lineno_str, lineno_str + 1); | 236 | htmlf("' id='%s'>%s</a>", lineno_str, lineno_str + 1); |
236 | html("</td>"); | 237 | html("</td>"); |
237 | htmlf("<td class='%s'>", class); | 238 | htmlf("<td class='%s'>", class); |
239 | free(fileurl); | ||
238 | } else if (old_line) | 240 | } else if (old_line) |
239 | htmlf("<td class='lineno'></td><td class='%s'>", class); | 241 | htmlf("<td class='lineno'></td><td class='%s'>", class); |
240 | else | 242 | else |
@@ -251,11 +253,13 @@ static void print_ssdiff_line(char *class, | |||
251 | struct diff_filespec *new_file = cgit_get_current_new_file(); | 253 | struct diff_filespec *new_file = cgit_get_current_new_file(); |
252 | char *lineno_str = fmt("n%d", new_line_no); | 254 | char *lineno_str = fmt("n%d", new_line_no); |
253 | char *id_str = fmt("id=%s#%s", is_null_sha1(new_file->sha1)?"HEAD":sha1_to_hex(new_rev_sha1), lineno_str); | 255 | char *id_str = fmt("id=%s#%s", is_null_sha1(new_file->sha1)?"HEAD":sha1_to_hex(new_rev_sha1), lineno_str); |
256 | char *fileurl = cgit_fileurl(ctx.repo->url, "tree", new_file->path, id_str); | ||
254 | html("<td class='lineno'><a href='"); | 257 | html("<td class='lineno'><a href='"); |
255 | html(cgit_fileurl(ctx.repo->url, "tree", new_file->path, id_str)); | 258 | html(fileurl); |
256 | htmlf("' id='%s'>%s</a>", lineno_str, lineno_str + 1); | 259 | htmlf("' id='%s'>%s</a>", lineno_str, lineno_str + 1); |
257 | html("</td>"); | 260 | html("</td>"); |
258 | htmlf("<td class='%s'>", class); | 261 | htmlf("<td class='%s'>", class); |
262 | free(fileurl); | ||
259 | } else if (new_line) | 263 | } else if (new_line) |
260 | htmlf("<td class='lineno'></td><td class='%s'>", class); | 264 | htmlf("<td class='lineno'></td><td class='%s'>", class); |
261 | else | 265 | else |