diff options
author | Brad King <brad.king@kitware.com> | 2014-04-03 18:37:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-04-03 19:02:49 (GMT) |
commit | 2f1978632b709a9370b3cb1137375c05351d149c (patch) | |
tree | 85980710818211b8188709643e6714e8839feee9 /Utilities/cmlibarchive/libarchive/archive_getdate.c | |
parent | 23e4666cf57c31c719472debba83a43f54d351d8 (diff) | |
parent | 64713ae3ffddf6fbbfa7ea762c3d756cb245a066 (diff) | |
download | CMake-2f1978632b709a9370b3cb1137375c05351d149c.zip CMake-2f1978632b709a9370b3cb1137375c05351d149c.tar.gz CMake-2f1978632b709a9370b3cb1137375c05351d149c.tar.bz2 |
Merge branch 'libarchive-upstream' into update-libarchive
Resolve conflicts in favor of the upstream side where possible.
Resolve a logical conflict in archive_windows.h where the upstream
port to Watcom was done slightly differently from ours.
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_getdate.c')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_getdate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_getdate.c b/Utilities/cmlibarchive/libarchive/archive_getdate.c index f8b5a28..aaa9d6f 100644 --- a/Utilities/cmlibarchive/libarchive/archive_getdate.c +++ b/Utilities/cmlibarchive/libarchive/archive_getdate.c @@ -369,8 +369,8 @@ relunitphrase(struct gdstate *gds) && gds->tokenp[1].token == tSEC_UNIT) { /* "1 day" */ gds->HaveRel++; - gds->RelSeconds += gds->tokenp[1].value * gds->tokenp[2].value; - gds->tokenp += 3; + gds->RelSeconds += gds->tokenp[0].value * gds->tokenp[1].value; + gds->tokenp += 2; return 1; } if (gds->tokenp[0].token == '-' @@ -403,7 +403,7 @@ relunitphrase(struct gdstate *gds) /* "now", "tomorrow" */ gds->HaveRel++; gds->RelSeconds += gds->tokenp[0].value; - ++gds->tokenp; + gds->tokenp += 1; return 1; } if (gds->tokenp[0].token == tMONTH_UNIT) { @@ -1022,10 +1022,11 @@ int main(int argc, char **argv) { time_t d; + time_t now = time(NULL); while (*++argv != NULL) { (void)printf("Input: %s\n", *argv); - d = get_date(*argv); + d = get_date(now, *argv); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else |