]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-diff.c
filters/syntax-highlighting.sh: work around highlight --force bug
[ps-cgit] / ui-diff.c
index d21541bd4d2b79d19222fc9dd09ae14e70d59e51..f8782df260c03a5231ecb740658caff4e3f8a583 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -97,10 +97,12 @@ static void print_fileinfo(struct fileinfo *info)
        htmlf("</td><td class='%s'>", class);
        cgit_diff_link(info->new_path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
                       ctx.qry.sha2, info->new_path, 0);
-       if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED)
-               htmlf(" (%s from %s)",
-                     info->status == DIFF_STATUS_COPIED ? "copied" : "renamed",
-                     info->old_path);
+       if (info->status == DIFF_STATUS_COPIED || info->status == DIFF_STATUS_RENAMED) {
+               htmlf(" (%s from ",
+                     info->status == DIFF_STATUS_COPIED ? "copied" : "renamed");
+               html_txt(info->old_path);
+               html(")");
+       }
        html("</td><td class='right'>");
        if (info->binary) {
                htmlf("bin</td><td class='graph'>%ld -> %ld bytes",
@@ -370,8 +372,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
                }
        }
 
-       if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff))
-               use_ssdiff = 1;
+       use_ssdiff = ctx.qry.has_ssdiff ? ctx.qry.ssdiff : ctx.cfg.ssdiff;
 
        print_ssdiff_link();
        cgit_print_diffstat(old_rev_sha1, new_rev_sha1, prefix);