int p;
const char *rv;
strncpy(rvbuf, reponame, sizeof(rvbuf));
- if(rvbuf[sizeof(rvbuf)-1])
+ if (rvbuf[sizeof(rvbuf)-1])
die("cgit_repobasename: truncated repository name '%s'", reponame);
p = strlen(rvbuf)-1;
/* strip trailing slashes */
- while(p && rvbuf[p] == '/') rvbuf[p--] = 0;
+ while (p && rvbuf[p] == '/') rvbuf[p--] = 0;
/* strip trailing .git */
- if(p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) {
+ if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) {
p -= 3; rvbuf[p--] = 0;
}
/* strip more trailing slashes if any */
- while( p && rvbuf[p] == '/') rvbuf[p--] = 0;
+ while ( p && rvbuf[p] == '/') rvbuf[p--] = 0;
/* find last slash in the remaining string */
rv = strrchr(rvbuf,'/');
- if(rv)
+ if (rv)
return ++rv;
return rvbuf;
}
-char *cgit_currurl()
+static char *cgit_currurl()
{
if (!ctx.cfg.virtual_root)
return ctx.cfg.script_name;
reporevlink("stats", name, title, class, head, NULL, path);
}
-void cgit_self_link(char *name, const char *title, const char *class,
- struct cgit_context *ctx)
+static void cgit_self_link(char *name, const char *title, const char *class,
+ struct cgit_context *ctx)
{
if (!strcmp(ctx->qry.page, "repolist"))
return cgit_index_link(name, title, class, ctx->qry.search, ctx->qry.sort,
reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL);
}
-struct string_list_item *lookup_path(struct string_list *list,
- const char *path)
+static struct string_list_item *lookup_path(struct string_list *list,
+ const char *path)
{
struct string_list_item *item;
if (!secs)
return;
- if(local_time)
+ if (local_time)
time = localtime(&secs);
else
time = gmtime(&secs);
html("</body>\n</html>\n");
}
-int print_branch_option(const char *refname, const unsigned char *sha1,
- int flags, void *cb_data)
+static int print_branch_option(const char *refname, const unsigned char *sha1,
+ int flags, void *cb_data)
{
char *name = (char *)refname;
html_option(name, name, ctx.qry.head);
return 0;
}
-int print_archive_ref(const char *refname, const unsigned char *sha1,
- int flags, void *cb_data)
+static int print_archive_ref(const char *refname, const unsigned char *sha1,
+ int flags, void *cb_data)
{
struct tag *tag;
struct taginfo *info;