From 8ed81fc62d8d0c70177b5a8c28a6c7fd34ab6729 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 6 Aug 2026 15:17:34 -0700 Subject: fully support pre-epoch timestamps not sure why, but why not --- backomp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/backomp b/backomp index 1d465fa..afc9b96 100755 --- a/backomp +++ b/backomp @@ -16,7 +16,7 @@ EOF read -rd '' AWK_FILTER <<'EOF' function flr(n, s) { - return int(n / s) * s + return n - (((n % s) + s) % s) } function mstart(t) { @@ -36,10 +36,10 @@ BEGIN { buckets[++n_buckets] = b } - split("sun mon tue wed thu fri sat", arr) + split("mon tue wed thu fri sat sun", arr) for (i in arr) arr2[arr[i]] = i - 1 - wshift = (11 - arr2[opt_week_start])*24*60*60 + wshift = (10 - arr2[opt_week_start])*24*60*60 } !n_buckets || keep_first && NR == 1 { @@ -49,10 +49,6 @@ BEGIN { n_buckets { t = mktime(gensub(/(.*\/|^)(.+)-(..)-(..)-(..)(..)(..)$/, "\\2 \\3 \\4 \\5 \\6 \\7", 1), 1) - if (t < 0) { - ++keep[$0] - next - } bt["h"] = flr(t, 60*60) bt["d"] = flr(t, 24*60*60) @@ -71,8 +67,9 @@ n_buckets { } } - if (newest_in[b] && bt[b] == last[b, b] && (i == 1 || - bt[buckets[i-1]] != last[b, buckets[i-1]])) + if (newest_in[b] && (b, b) in last && bt[b] == last[b, b] && + (i == 1 || bt[buckets[i-1]] != \ + last[b, buckets[i-1]])) next if ((b, bt[b]) in bkeep || ret[b] == "*" || bc[b]++ < ret[b]) -- cgit v1.3.1