From a5bc469339d594863abe2d914f6d99a76a3704ca Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 18 Aug 2004 08:52:54 -0400 Subject: BUG: When GetNightlyTime returns past time, fix everything. Also, return correct time when printing --- Source/cmCTest.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index fef1bfd..74e3912 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -60,6 +60,7 @@ static struct tm* GetNightlyTime(std::string str, bool verbose, bool tomorrowtag if ( verbose ) { std::cout << "Determine Nightly Start Time" << std::endl; + std::cout << " Specified time: " << str.c_str() << std::endl; } //Convert the nightly start time to seconds. Since we are //providing only a time and a timezone, the current date of @@ -75,7 +76,7 @@ static struct tm* GetNightlyTime(std::string str, bool verbose, bool tomorrowtag tctime = time(0); if ( verbose ) { - std::cout << " Get the current time: " << ntime << std::endl; + std::cout << " Get the current time: " << tctime << std::endl; } const int dayLength = 24 * 60 * 60; @@ -94,7 +95,7 @@ static struct tm* GetNightlyTime(std::string str, bool verbose, bool tomorrowtag std::cout << " Future time, subtract day: " << ntime << std::endl; } } - if ( (ntime - tctime) > dayLength ) + if ( (tctime - ntime) > dayLength ) { ntime += dayLength; if ( verbose ) -- cgit v0.12