From b99ec91e28346c10df790709dd4a6dd97db0f75c Mon Sep 17 00:00:00 2001 From: danny Date: Tue, 5 Jan 1999 09:58:02 +0000 Subject: PR: 9323 Submitted by: ishisone@sra.co.jp Make touch handle years 2000-2038 in the obsoleted format, rather than 1902-1969 as was previously the case with two digit year spec. --- usr.bin/touch/touch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.bin/touch') diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index 712d72e..81e596a 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -260,8 +260,11 @@ stime_arg2(arg, year, tvp) t->tm_mday = ATOI2(arg); t->tm_hour = ATOI2(arg); t->tm_min = ATOI2(arg); - if (year) + if (year) { t->tm_year = ATOI2(arg); + if (t->tm_year < 38) /* support 2000-2038 not 1902-1969 */ + t->tm_year += 100; + } t->tm_isdst = -1; /* Figure out DST. */ tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); -- cgit v1.1