summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-12-06 11:21:53 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-12-06 11:21:53 (EST)
commit83bee70f80d8c98b875c943297b0049eae7d6d22 (patch)
tree073b0e62f0a4c6a0518cd6a5f2761a55a5a47e30
parent9248ba9230e9244994039a9fb6e3c666d7befe0a (diff)
ob_*_gmtime(): Don't freeze in December
-rw-r--r--NEWS9
-rw-r--r--lib/time.sh1
2 files changed, 10 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8abbf50..9667742 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,15 @@ opkbuild version 4.2.0+dev
Released: ????-??-??
+"Now winterized to prevent freezing in December!"
+
+libopkbuild:
+
+ * ob_iso8601_gmtime() and ob_touch_t_gmtime() no longer trigger an
+ infinite loop when passed times in December. This time bomb
+ introduced in opkbuild version 4.1.1 broke ob-buildopk one month
+ every year.
+
opkbuild version 4.2.0
----------------------
diff --git a/lib/time.sh b/lib/time.sh
index aa4990b..5100b04 100644
--- a/lib/time.sh
+++ b/lib/time.sh
@@ -52,6 +52,7 @@ _ob_month_to_days()
1) d=0;; 2) d=31;; 3) d=59;; 4) d=90;;
5) d=120;; 6) d=151;; 7) d=181;; 8) d=212;;
9) d=243;; 10) d=273;; 11) d=304;; 12) d=334;;
+ 13)d=365;;
esac
[ ${month} -ge 2 ] && _ob_is_leap_year ${year} && : $((++d))
printf '%d' ${d}