]> gitweb.ps.run Git - ps-cgit/blobdiff - shared.c
Merge branch 'stable'
[ps-cgit] / shared.c
index cd60da513daaecf085cf81b793f01628d5a9edf1..a764c4d6b25bbde782cafe159c0bef05ccc98f21 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -12,8 +12,6 @@ struct cgit_repolist cgit_repolist;
 struct cgit_context ctx;
 int cgit_cmd;
 
-const char *cgit_version = CGIT_VERSION;
-
 int chk_zero(int result, char *msg)
 {
        if (result != 0)
@@ -62,6 +60,7 @@ struct cgit_repo *cgit_add_repo(const char *url)
        ret->enable_log_linecount = ctx.cfg.enable_log_linecount;
        ret->module_link = ctx.cfg.module_link;
        ret->readme = NULL;
+       ret->mtime = -1;
        return ret;
 }
 
@@ -91,18 +90,6 @@ void *cgit_free_commitinfo(struct commitinfo *info)
        return NULL;
 }
 
-int hextoint(char c)
-{
-       if (c >= 'a' && c <= 'f')
-               return 10 + c - 'a';
-       else if (c >= 'A' && c <= 'F')
-               return 10 + c - 'A';
-       else if (c >= '0' && c <= '9')
-               return c - '0';
-       else
-               return -1;
-}
-
 char *trim_end(const char *str, char c)
 {
        int len;
@@ -280,10 +267,12 @@ int cgit_diff_files(const unsigned char *old_sha1,
        if (!load_mmfile(&file1, old_sha1) || !load_mmfile(&file2, new_sha1))
                return 1;
 
+       memset(&diff_params, 0, sizeof(diff_params));
+       memset(&emit_params, 0, sizeof(emit_params));
+       memset(&emit_cb, 0, sizeof(emit_cb));
        diff_params.flags = XDF_NEED_MINIMAL;
        emit_params.ctxlen = 3;
        emit_params.flags = XDL_EMIT_FUNCNAMES;
-       emit_params.find_func = NULL;
        emit_cb.outf = filediff_cb;
        emit_cb.priv = fn;
        xdl_diff(&file1, &file2, &diff_params, &emit_params, &emit_cb);