]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-repolist.c
Merge branch 'fh/filter-api'
[ps-cgit] / ui-repolist.c
index 3ef2e99deb18c3cff37a76d59dbc1f157671d666..6f304bb36006834da65a319da5163ffe6b1bed60 100644 (file)
@@ -6,12 +6,6 @@
  *   (see COPYING for full license text)
  */
 
  *   (see COPYING for full license text)
  */
 
-/* This is needed for strcasestr to be defined by <string.h> */
-#define _GNU_SOURCE 1
-#include <string.h>
-
-#include <time.h>
-
 #include "cgit.h"
 #include "html.h"
 #include "ui-shared.h"
 #include "cgit.h"
 #include "html.h"
 #include "ui-shared.h"
@@ -26,7 +20,7 @@ time_t read_agefile(char *path)
        if (readfile(path, &buf, &size))
                return -1;
 
        if (readfile(path, &buf, &size))
                return -1;
 
-       if (parse_date(buf, buf2, sizeof(buf2)))
+       if (parse_date(buf, buf2, sizeof(buf2)) > 0)
                result = strtoul(buf2, NULL, 10);
        else
                result = 0;
                result = strtoul(buf2, NULL, 10);
        else
                result = 0;
@@ -94,7 +88,7 @@ int is_in_url(struct cgit_repo *repo)
 
 void print_sort_header(const char *title, const char *sort)
 {
 
 void print_sort_header(const char *title, const char *sort)
 {
-       htmlf("<th class='left'><a href='./?s=%s", sort);
+       htmlf("<th class='left'><a href='%s?s=%s", cgit_rooturl(), sort);
        if (ctx.qry.search) {
                html("&q=");
                html_url_arg(ctx.qry.search);
        if (ctx.qry.search) {
                html("&q=");
                html_url_arg(ctx.qry.search);
@@ -297,7 +291,7 @@ void cgit_print_site_readme()
        if (!ctx.cfg.root_readme)
                return;
        if (ctx.cfg.about_filter)
        if (!ctx.cfg.root_readme)
                return;
        if (ctx.cfg.about_filter)
-               cgit_open_filter(ctx.cfg.about_filter);
+               cgit_open_filter(ctx.cfg.about_filter, NULL);
        html_include(ctx.cfg.root_readme);
        if (ctx.cfg.about_filter)
                cgit_close_filter(ctx.cfg.about_filter);
        html_include(ctx.cfg.root_readme);
        if (ctx.cfg.about_filter)
                cgit_close_filter(ctx.cfg.about_filter);