summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/lib/getdate.y
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/lib/getdate.y')
-rw-r--r--contrib/cvs/lib/getdate.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/cvs/lib/getdate.y b/contrib/cvs/lib/getdate.y
index fdb177d..9a4a8fa 100644
--- a/contrib/cvs/lib/getdate.y
+++ b/contrib/cvs/lib/getdate.y
@@ -619,6 +619,10 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
}
+/* Year is either
+ * A negative number, which means to use its absolute value (why?)
+ * A number from 0 to 99, which means a year from 1900 to 1999, or
+ * The actual year (>=100). */
static time_t
Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
time_t Month;
@@ -710,7 +714,7 @@ RelativeMonth(Start, RelMonth)
if (RelMonth == 0)
return 0;
tm = localtime(&Start);
- Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
+ Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth;
Year = Month / 12;
Month = Month % 12 + 1;
return DSTcorrect(Start,
OpenPOWER on IntegriCloud