all repos — cgit @ bb3cc0d9666553608b7c89aef84d21d3312ce488

a hyperfast web frontend for git written in c

ui-shared: do not allow negative minutes

Do to timestamp differences, sometimes cgit would should "-0 min", which
doesn't make any sense.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Jason A. Donenfeld Jason@zx2c4.com
Fri, 17 Jan 2014 15:41:41 +0100
commit

bb3cc0d9666553608b7c89aef84d21d3312ce488

parent

9dde6d38e9fc273fc62386eeda0da2e89a2cebfc

1 files changed, 2 insertions(+), 0 deletions(-)

jump to
M ui-shared.cui-shared.c

@@ -596,6 +596,8 @@ if (!t)

return; time(&now); secs = now - t; + if (secs < 0) + secs = 0; if (secs > max_relative && max_relative >= 0) { cgit_print_date(t, format, ctx.cfg.local_time);