]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
Use absolute path for scanned repo readme
[ps-cgit] / ui-plain.c
index a4ce077ac512f4735ea693967a5a0b375473bbf7..5569a7cb3b107188385f45a96cde0e044e424f14 100644 (file)
@@ -35,7 +35,7 @@ static void print_object(const unsigned char *sha1, const char *path)
        ctx.page.mimetype = NULL;
        ext = strrchr(path, '.');
        if (ext && *(++ext)) {
-               mime = string_list_lookup(ext, &ctx.cfg.mimetypes);
+               mime = string_list_lookup(&ctx.cfg.mimetypes, ext);
                if (mime)
                        ctx.page.mimetype = (char *)mime->util;
        }
@@ -88,7 +88,7 @@ void cgit_print_plain(struct cgit_context *ctx)
                return;
        }
        match_path = ctx->qry.path;
-       read_tree_recursive(commit->tree, NULL, 0, 0, paths, walk_tree, NULL);
+       read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
        if (!match)
                html_status(404, "Not found", 0);
 }