- const char *sep = "";
- if (S_ISDIR(mode))
- sep = "/";
- htmlf(" <li><a href=\"%s%s\">%s%s</a></li>\n", path, sep, path, sep);
- match = 2;
+ char *fullpath;
+
+ fullpath = buildpath(base, baselen, path);
+ if (!S_ISDIR(mode) && !S_ISGITLINK(mode))
+ fullpath[strlen(fullpath) - 1] = 0;
+ html(" <li>");
+ if (S_ISGITLINK(mode)) {
+ cgit_submodule_link(NULL, fullpath, sha1_to_hex(sha1));
+ } else
+ cgit_plain_link(path, NULL, NULL, ctx.qry.head, ctx.qry.sha1,
+ fullpath);
+ html("</li>\n");
+ free(fullpath);