diff options
-rwxr-xr-x | backomp | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -3,7 +3,9 @@ set -e ! read -rd '' FILTER_AWK <<'EOF' -function flr(n, s) { return int(n / s) * s } +function flr(n, s) { + return int(n / s) * s +} BEGIN { len = split("h d w m", arr) @@ -31,12 +33,13 @@ BEGIN { for (i = 1; i <= n_buckets; ++i) { b = buckets[i] - if (skip = (repl[b] && bt[b] == last[b, b])) { + if (repl[b] && bt[b] == last[b, b]) { for (j = 1; j < i; ++j) { - skip = (bt[buckets[j]] != last[b, buckets[j]]) - if (!skip) break + if (bt[buckets[j]] == last[b, buckets[j]]) + break } - if (skip) next + if (j == i) + next } if ((b, bt[b]) in bkeep || ret[b] == "*" || bc[b]++ < ret[b]) @@ -52,7 +55,8 @@ END { ++keep[bkeep[i]] asorti(keep) - for (i in keep) print keep[i] + for (i in keep) + print keep[i] } EOF |