diff --git a/ChangeLog b/ChangeLog index 4e7c6af47..50ab44278 100644 --- a/ChangeLog +++ b/ChangeLog @@ -89,6 +89,7 @@ - TW-1301 Virtual tag +PENDING (thanks to Profpatsch). - TW-1302 CmdShow.cpp:244: bad length in substr ? (thanks to David Binderman). - TW-1304 Minor build and install fix for NetBSD (thanks to atomicules). +- TW-1306 Arguments before 'add' are ignored. - TW-1307 burndown is aliased to burndown.weekly (thanks to darkfeline). - TW-1309 memory error, if misconfigured calendar.details.report (thanks to Onion). diff --git a/src/Parser.cpp b/src/Parser.cpp index d225a6440..960d66606 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -178,6 +178,7 @@ Tree* Parser::parse () findIdSequence (); findFilter (); findModifications (); + findStrayModifications (); findPlainArgs (); findMissingOperators (); @@ -1426,6 +1427,26 @@ void Parser::findModifications () } } +//////////////////////////////////////////////////////////////////////////////// +void Parser::findStrayModifications () +{ + std::string command = getCommand (); + if (command == "add" || + command == "log") + { + std::vector ::iterator i; + for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i) + { + if ((*i)->hasTag ("FILTER")) + { + (*i)->unTag ("FILTER"); + (*i)->tag ("MODIFICATION"); + (*i)->removeAllBranches (); + } + } + } +} + //////////////////////////////////////////////////////////////////////////////// // This is called after parsing. The intention is to find plain arguments that // are not otherwise recognized, and potentially promote them to patterns. diff --git a/src/Parser.h b/src/Parser.h index ea09b5353..ea9db1386 100644 --- a/src/Parser.h +++ b/src/Parser.h @@ -75,6 +75,7 @@ private: void findOperator (); void findFilter (); void findModifications (); + void findStrayModifications (); void findPlainArgs (); void findMissingOperators (); bool insertOr ();