From 2f99905b1f22b5828bb69b6648f5fa03ed8415e3 Mon Sep 17 00:00:00 2001 From: kientzle Date: Thu, 2 Nov 2006 04:16:15 +0000 Subject: [PATCH] Fix "1 day ago", "yesterday" and similar relative-time phrases when parsing dates. PR: bin/104934: bug in some date handling of bsdtar Reported by: Herve Boulouis MFC after: 3 days --- usr.bin/tar/getdate.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tar/getdate.y b/usr.bin/tar/getdate.y index b40058c09b21..c18e2d33885a 100644 --- a/usr.bin/tar/getdate.y +++ b/usr.bin/tar/getdate.y @@ -270,11 +270,11 @@ relunit : '-' tUNUMBER tSEC_UNIT { } | tUNUMBER tSEC_UNIT { /* "1 day" */ - yyRelSeconds += $1; + yyRelSeconds += $1 * $2; } | tSEC_UNIT { /* "hour" */ - yyRelSeconds++; + yyRelSeconds += $1; } | '-' tUNUMBER tMONTH_UNIT { /* "-3 months" */