From 0440189b1d5db5a278ec2fcc17d45e59e2cb14ae Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 26 Jun 2009 00:05:33 -0400 Subject: [PATCH] Bug Fix - Fixed bug that caused Att::match to assume a Date was not already converted to an epoch. --- src/Att.cpp | 5 ++--- src/Context.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Att.cpp b/src/Att.cpp index f7e92adcd..65b2efb59 100644 --- a/src/Att.cpp +++ b/src/Att.cpp @@ -236,7 +236,6 @@ bool Att::validNameValue ( autoComplete (name, candidates, matches); if (matches.size () == 0) -// throw std::string ("Unrecognized attribute '") + name + "'"; return false; else if (matches.size () != 1) @@ -559,7 +558,7 @@ bool Att::match (const Att& other) const } else if (which == "date") { - Date literal (mValue); + Date literal ((time_t)::atoi (mValue.c_str ())); Date variable ((time_t)::atoi (other.mValue.c_str ())); if (! (variable < literal)) return false; @@ -589,7 +588,7 @@ bool Att::match (const Att& other) const } else if (which == "date") { - Date literal (mValue); + Date literal ((time_t)::atoi (mValue.c_str ())); Date variable ((time_t)::atoi (other.mValue.c_str ())); if (! (variable > literal)) return false; diff --git a/src/Context.cpp b/src/Context.cpp index e51da9f96..a4752d78c 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -552,12 +552,7 @@ void Context::parse ( // At this point, either a sequence or a command should have been found. if (parseSequence.size () == 0 && parseCmd.command == "") - { parseCmd.parse (descCandidate); - throw stringtable.get ( - CMD_MISSING, - "You must specify a command, or a task ID to modify"); - } // Read-only command (reports, status, info ...) use filters. Write commands // (add, done ...) do not. @@ -580,6 +575,10 @@ void Context::parse ( initialize (); parse (args, cmd, task, sequence, subst, filter); } + else + throw stringtable.get ( + CMD_MISSING, + "You must specify a command, or a task ID to modify"); } }