=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/touch/touch.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/touch/touch.c 2000/09/20 13:26:55 1.4 --- src/usr.bin/touch/touch.c 2000/09/20 22:25:26 1.5 *************** *** 1,4 **** ! /* $OpenBSD: touch.c,v 1.4 2000/09/20 13:26:55 pjanzen Exp $ */ /* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: touch.c,v 1.5 2000/09/20 22:25:26 pjanzen Exp $ */ /* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)touch.c 8.2 (Berkeley) 4/28/95"; #endif ! static char rcsid[] = "$OpenBSD: touch.c,v 1.4 2000/09/20 13:26:55 pjanzen Exp $"; #endif /* not lint */ #include --- 44,50 ---- #if 0 static char sccsid[] = "@(#)touch.c 8.2 (Berkeley) 4/28/95"; #endif ! static char rcsid[] = "$OpenBSD: touch.c,v 1.5 2000/09/20 22:25:26 pjanzen Exp $"; #endif /* not lint */ #include *************** *** 59,64 **** --- 59,65 ---- #include #include #include + #include #include int rw __P((char *, struct stat *, int)); *************** *** 226,236 **** } else { yearset = ATOI2(arg); if (yearset < 69) ! t->tm_year = yearset + 2000; else ! t->tm_year = yearset + 1900; } - t->tm_year -= 1900; /* Convert to UNIX time. */ /* FALLTHROUGH */ case 8: /* MMDDhhmm */ t->tm_mon = ATOI2(arg); --- 227,236 ---- } else { yearset = ATOI2(arg); if (yearset < 69) ! t->tm_year = yearset + 2000 - TM_YEAR_BASE; else ! t->tm_year = yearset + 1900 - TM_YEAR_BASE; } /* FALLTHROUGH */ case 8: /* MMDDhhmm */ t->tm_mon = ATOI2(arg); *************** *** 271,280 **** t->tm_hour = ATOI2(arg); t->tm_min = ATOI2(arg); if (year) { ! t->tm_year = ATOI2(arg); ! if (t->tm_year < 69) ! t->tm_year += 100; } t->tm_isdst = -1; /* Figure out DST. */ tvp[0].tv_sec = tvp[1].tv_sec = mktime(t); --- 271,283 ---- t->tm_hour = ATOI2(arg); t->tm_min = ATOI2(arg); if (year) { ! year = ATOI2(arg); ! if (year < 69) ! t->tm_year = year + 2000 - TM_YEAR_BASE; ! else ! t->tm_year = year + 1900 - TM_YEAR_BASE; } + t->tm_sec = 0; t->tm_isdst = -1; /* Figure out DST. */ tvp[0].tv_sec = tvp[1].tv_sec = mktime(t);