]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
ui-atom: generate valid Atom feeds
[ps-cgit] / ui-shared.c
index 151ac1797aa99351e63b9872d6f804eedda65431..fbf5a2d9dbe0bca892bd8f65071eac809c2667d2 100644 (file)
@@ -22,10 +22,11 @@ static char *http_date(time_t t)
        static char month[][4] =
                {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
                 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
-       struct tm *tm = gmtime(&t);
-       return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
-                  tm->tm_mday, month[tm->tm_mon], 1900 + tm->tm_year,
-                  tm->tm_hour, tm->tm_min, tm->tm_sec);
+       struct tm tm;
+       gmtime_r(&t, &tm);
+       return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm.tm_wday],
+                  tm.tm_mday, month[tm.tm_mon], 1900 + tm.tm_year,
+                  tm.tm_hour, tm.tm_min, tm.tm_sec);
 }
 
 void cgit_print_error(const char *fmt, ...)
@@ -994,7 +995,7 @@ static void print_header(void)
        if (ctx.repo) {
                cgit_index_link("index", NULL, NULL, NULL, NULL, 0, 1);
                html(" : ");
-               cgit_summary_link(ctx.repo->name, ctx.repo->name, NULL, NULL);
+               cgit_summary_link(ctx.repo->name, NULL, NULL, NULL);
                if (ctx.env.authenticated) {
                        html("</td><td class='form'>");
                        html("<form method='get'>\n");
@@ -1015,7 +1016,13 @@ static void print_header(void)
        if (ctx.repo) {
                html_txt(ctx.repo->desc);
                html("</td><td class='sub right'>");
-               html_txt(ctx.repo->owner);
+               if (ctx.repo->owner_filter) {
+                       cgit_open_filter(ctx.repo->owner_filter);
+                       html_txt(ctx.repo->owner);
+                       cgit_close_filter(ctx.repo->owner_filter);
+               } else {
+                       html_txt(ctx.repo->owner);
+               }
        } else {
                if (ctx.cfg.root_desc)
                        html_txt(ctx.cfg.root_desc);