summarylogtreecommitdiffstats
path: root/y2k.patch
diff options
context:
space:
mode:
Diffstat (limited to 'y2k.patch')
-rw-r--r--y2k.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/y2k.patch b/y2k.patch
new file mode 100644
index 000000000000..4605ad5052bd
--- /dev/null
+++ b/y2k.patch
@@ -0,0 +1,29 @@
+diff -Naur ../datemath/util.c ./util.c
+--- ../datemath/util.c 2004-03-06 18:27:59.000000000 +0100
++++ ./util.c 2012-08-01 09:37:30.767738221 +0200
+@@ -18,6 +18,7 @@
+ #include "defs.h"
+
+ int century19_year = 40; /* 0..39 = 2000 / 40..99 = 1999 */
++static int century; /* may not be 1900... */
+
+ /*
+ * jultoyymm()
+@@ -35,6 +36,8 @@
+
+ if (mdy[YY] < 1900) /* too early? */
+ mdy[YY] = 1900;
++
++ century = mdy[YY] / 100;
+
+ mdy[YY] %= 100; /* strip off 19xx */
+
+@@ -59,7 +62,7 @@
+ mdy[YY] = yymm / 100;
+ mdy[DD] = eflag ? daysinmm(mdy[MM], mdy[YY]) : 1;
+
+- mdy[YY] += 1900;
++ mdy[YY] += century * 100;
+
+ if (rv = rmdyjul(mdy, &jdate), rv < 0)
+ die("bad date conversion in yymmtojul-(%d)", rv);