From 477077497f51abe3eb2fd22c5368376375cc75d3 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Sun, 16 Feb 2025 20:24:22 +0100 Subject: [PATCH] Revert upstreams strtoday calculation "fix" Closes: #1095430 --- ...-strtoday.c-strtoday-Fix-calculation.patch | 28 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 29 insertions(+) create mode 100644 debian/patches/Revert-lib-strtoday.c-strtoday-Fix-calculation.patch diff --git a/debian/patches/Revert-lib-strtoday.c-strtoday-Fix-calculation.patch b/debian/patches/Revert-lib-strtoday.c-strtoday-Fix-calculation.patch new file mode 100644 index 00000000..e656f537 --- /dev/null +++ b/debian/patches/Revert-lib-strtoday.c-strtoday-Fix-calculation.patch @@ -0,0 +1,28 @@ +From: Chris Hofstaedtler +Date: Sun, 16 Feb 2025 20:21:35 +0100 +Subject: Revert "lib/strtoday.c: strtoday(): Fix calculation" + +This reverts commit 1175932c0c86ee46ee298fd9cfa01653a2ba3a27. + +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095430 +--- + lib/strtoday.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/strtoday.c b/lib/strtoday.c +index 01f2e9b..f947778 100644 +--- a/lib/strtoday.c ++++ b/lib/strtoday.c +@@ -67,9 +67,10 @@ long strtoday (const char *str) + return retdate; + } + +- t = get_date(str, NULL); ++ t = get_date (str, NULL); + if ((time_t) - 1 == t) { + return -2; + } +- return t / DAY; ++ /* convert seconds to days since 1970-01-01 */ ++ return (t + DAY / 2) / DAY; + } diff --git a/debian/patches/series b/debian/patches/series index bb49502e..94212c93 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,3 +9,4 @@ debian/Stop-building-programs-we-do-not-install.patch upstream/a015e919834c90b99947829c6c823f7fe93a8097-E_BAD_NAME.patch upstream/man-useradd.8.xml-Document-new-exit-code-19-E_BAD_NAME.patch upstream/Revert-lib-src-Use-local-time-for-human-readable-dates.patch +Revert-lib-strtoday.c-strtoday-Fix-calculation.patch