X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/fb3655df3bf85bd405c5921bbd4b3a54c705c839..da218fcd9eb554a8405ca72e84bcc0feb371194f:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 519eef7..2c12de7 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1,6 +1,6 @@ /* ui-shared.c: common web output functions * - * Copyright (C) 2006 Lars Hjemli + * Copyright (C) 2006-2014 cgit Development Team * * Licensed under GNU General Public License v2 * (see COPYING for full license text) @@ -120,7 +120,7 @@ const char *cgit_repobasename(const char *reponame) /* strip trailing slashes */ while (p && rvbuf[p] == '/') rvbuf[p--] = 0; /* strip trailing .git */ - if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) { + if (p >= 3 && !prefixcmp(&rvbuf[p-3], ".git")) { p -= 3; rvbuf[p--] = 0; } /* strip more trailing slashes if any */ @@ -864,7 +864,7 @@ void cgit_print_pageheader(struct cgit_context *ctx) if (ctx->repo->max_stats) cgit_stats_link("stats", NULL, hc(ctx, "stats"), ctx->qry.head, ctx->qry.vpath); - if (ctx->repo->readme) + if (ctx->repo->readme.nr) reporevlink("about", "about", NULL, hc(ctx, "about"), ctx->qry.head, NULL, NULL);