all repos — cgit @ ccd0d09e29ed887a848bd6d79bddfc218be8ecd7

a hyperfast web frontend for git written in c

Merge remote-tracking branch 'upstream/master' into git.aaoth.xyz
la-ninpre leobrekalini@gmail.com
Tue, 30 Mar 2021 19:59:13 +0300
commit

ccd0d09e29ed887a848bd6d79bddfc218be8ecd7

parent

d366ec1e1e796937387208ef8c26097e5ff44ae9

7 files changed, 40 insertions(+), 37 deletions(-)

jump to
M MakefileMakefile

@@ -14,7 +14,7 @@ htmldir = $(docdir)

pdfdir = $(docdir) mandir = $(prefix)/share/man SHA1_HEADER = <openssl/sha.h> -GIT_VER = 2.29.0 +GIT_VER = 2.30.0 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz INSTALL = install COPYTREE = cp -r
M cache.ccache.c

@@ -401,12 +401,12 @@ */

static char *sprintftime(const char *format, time_t time) { static char buf[64]; - struct tm *tm; + struct tm tm; if (!time) return NULL; - tm = gmtime(&time); - strftime(buf, sizeof(buf)-1, format, tm); + gmtime_r(&time, &tm); + strftime(buf, sizeof(buf)-1, format, &tm); return buf; }
M filters/html-converters/md2htmlfilters/html-converters/md2html

@@ -301,6 +301,7 @@ extensions=[

"markdown.extensions.fenced_code", "markdown.extensions.codehilite", "markdown.extensions.tables", + "markdown.extensions.sane_lists", TocExtension(anchorlink=True)], extension_configs={ "markdown.extensions.codehilite":{"css_class":"highlight"}})
M tests/t0107-snapshot.shtests/t0107-snapshot.sh

@@ -25,7 +25,7 @@ '

test_expect_success 'untar' ' rm -rf master && - tar -xzf master.tar.gz + gzip -dc master.tar.gz | tar -xf - ' test_expect_success 'count files' '

@@ -66,7 +66,7 @@ '

test_expect_success LZIP 'untar' ' rm -rf master && - tar --lzip -xf master.tar.lz + lzip -dc master.tar.lz | tar -xf - ' test_expect_success LZIP 'count files' '

@@ -107,7 +107,7 @@ '

test_expect_success XZ 'untar' ' rm -rf master && - tar --xz -xf master.tar.xz + xz -dc master.tar.xz | tar -xf - ' test_expect_success XZ 'count files' '

@@ -148,7 +148,7 @@ '

test_expect_success ZSTD 'untar' ' rm -rf master && - tar --zstd -xf master.tar.zst + zstd -dc master.tar.zst | tar -xf - ' test_expect_success ZSTD 'count files' '
M ui-blame.cui-blame.c

@@ -132,7 +132,8 @@ setup_revisions(rev_argv.nr, rev_argv.v, &revs, NULL);

init_scoreboard(&sb); sb.revs = &revs; sb.repo = the_repository; - setup_scoreboard(&sb, path, &o); + sb.path = path; + setup_scoreboard(&sb, &o); o->suspects = blame_entry_prepend(NULL, 0, sb.num_lines, o); prio_queue_put(&sb.commits, o->commit); blame_origin_decref(o);
M ui-shared.cui-shared.c

@@ -22,10 +22,11 @@ {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};

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, ...)
M ui-stats.cui-stats.c

@@ -166,7 +166,7 @@ struct string_list_item *author, *item;

struct authorstat *authorstat; struct string_list *items; char *tmp; - struct tm *date; + struct tm date; time_t t; uintptr_t *counter;

@@ -180,9 +180,9 @@ free(tmp);

authorstat = author->util; items = &authorstat->list; t = info->committer_date; - date = gmtime(&t); - period->trunc(date); - tmp = xstrdup(period->pretty(date)); + gmtime_r(&t, &date); + period->trunc(&date); + tmp = xstrdup(period->pretty(&date)); item = string_list_insert(items, tmp); counter = (uintptr_t *)&item->util; if (*counter)

@@ -215,15 +215,15 @@ const char *argv[] = {NULL, ctx.qry.head, NULL, NULL, NULL, NULL};

int argc = 3; time_t now; long i; - struct tm *tm; + struct tm tm; char tmp[11]; time(&now); - tm = gmtime(&now); - period->trunc(tm); + gmtime_r(&now, &tm); + period->trunc(&tm); for (i = 1; i < period->count; i++) - period->dec(tm); - strftime(tmp, sizeof(tmp), "%Y-%m-%d", tm); + period->dec(&tm); + strftime(tmp, sizeof(tmp), "%Y-%m-%d", &tm); argv[2] = xstrdup(fmt("--since=%s", tmp)); if (ctx.qry.path) { argv[3] = "--";

@@ -261,21 +261,21 @@ struct string_list *items;

struct string_list_item *date; time_t now; long i, j, total, subtotal; - struct tm *tm; + struct tm tm; char *tmp; time(&now); - tm = gmtime(&now); - period->trunc(tm); + gmtime_r(&now, &tm); + period->trunc(&tm); for (i = 1; i < period->count; i++) - period->dec(tm); + period->dec(&tm); total = 0; htmlf("<tr><td class='%s'>%s</td>", leftclass, fmt(name, to - from + 1)); for (j = 0; j < period->count; j++) { - tmp = period->pretty(tm); - period->inc(tm); + tmp = period->pretty(&tm); + period->inc(&tm); subtotal = 0; for (i = from; i <= to; i++) { author = &authors->items[i];

@@ -300,20 +300,20 @@ struct string_list *items;

struct string_list_item *date; time_t now; long i, j, total; - struct tm *tm; + struct tm tm; char *tmp; time(&now); - tm = gmtime(&now); - period->trunc(tm); + gmtime_r(&now, &tm); + period->trunc(&tm); for (i = 1; i < period->count; i++) - period->dec(tm); + period->dec(&tm); html("<table class='stats' width='100%'><tr><th>Author</th>"); for (j = 0; j < period->count; j++) { - tmp = period->pretty(tm); + tmp = period->pretty(&tm); htmlf("<th>%s</th>", tmp); - period->inc(tm); + period->inc(&tm); } html("<th>Total</th></tr>\n");

@@ -329,10 +329,10 @@ authorstat = author->util;

items = &authorstat->list; total = 0; for (j = 0; j < period->count; j++) - period->dec(tm); + period->dec(&tm); for (j = 0; j < period->count; j++) { - tmp = period->pretty(tm); - period->inc(tm); + tmp = period->pretty(&tm); + period->inc(&tm); date = string_list_lookup(items, tmp); if (!date) html("<td>0</td>");