Subject: bug#43677: 27.1; Calc holidays off-by-one error, incorrect business day calculation

From: Mattias Engdegård <[email-masked]>
Date: Wed, 30 Sep 2020 18:12:43 +0200

30 sep. 2020 kl. 15.40 skrev Lars Ingebrigtsen <[email-masked]>:

> That's quite a stretch to be bisecting, though...

Bisecting is logarithmic so large stretches are seldom a problem. You can also bisect restricted to one path which reduces the number of versions dramatically. (Building old versions of Emacs, on the other hand -- that can be messy!)

But you don't have to! I found it. The error was introduced in the calendar changes between c9f618db441 and fd1f1603a4f, during which the internal date numbering changed: date Jan 1, 1 AD went from date 0 to 1. However, the business days code remained unchanged and thus started getting the weekdays wrong.

Of course there were no tests but that is excusable since this was 2012 and tests weren't invented back then.

I'll put together a patch a little later today or tomorrow.