mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Bug #818
- Fixed bug #818, which caused partial tag matching (thanks to Joe Holloway). - Note that the regex word boundary anchors are different for Solaris and Linux, and largely broken on OSX. - Added unit tests.
This commit is contained in:
parent
efb2476c15
commit
28a4947234
5 changed files with 97 additions and 9 deletions
16
src/A3.cpp
16
src/A3.cpp
|
@ -1017,10 +1017,14 @@ const A3 A3::expand (const A3& input) const
|
|||
{
|
||||
expanded.push_back (Arg (name, Arg::type_string, Arg::cat_dom));
|
||||
expanded.push_back (Arg ("~", Arg::cat_op));
|
||||
#ifdef DARWIN
|
||||
expanded.push_back (Arg (value, Arg::type_string, Arg::cat_literal));
|
||||
#else
|
||||
#ifdef SOLARIS
|
||||
expanded.push_back (Arg ("\\<" + value + "\\>", Arg::type_string, Arg::cat_rx));
|
||||
#else
|
||||
expanded.push_back (Arg ("\\b" + value + "\\b", Arg::type_string, Arg::cat_rx));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1029,10 +1033,14 @@ const A3 A3::expand (const A3& input) const
|
|||
{
|
||||
expanded.push_back (Arg (name, Arg::type_string, Arg::cat_dom));
|
||||
expanded.push_back (Arg ("!~", Arg::cat_op));
|
||||
#ifdef DARWIN
|
||||
expanded.push_back (Arg (value, Arg::type_string, Arg::cat_literal));
|
||||
#else
|
||||
#ifdef SOLARIS
|
||||
expanded.push_back (Arg ("\\<" + value + "\\>", Arg::type_string, Arg::cat_rx));
|
||||
#else
|
||||
expanded.push_back (Arg ("\\b" + value + "\\b", Arg::type_string, Arg::cat_rx));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -1048,7 +1056,15 @@ const A3 A3::expand (const A3& input) const
|
|||
|
||||
expanded.push_back (Arg ("tags", Arg::type_string, Arg::cat_dom));
|
||||
expanded.push_back (Arg (type == '+' ? "~" : "!~", Arg::cat_op));
|
||||
#ifdef DARWIN
|
||||
expanded.push_back (Arg (value, Arg::type_string, Arg::cat_literal));
|
||||
#else
|
||||
#ifdef SOLARIS
|
||||
expanded.push_back (Arg ("\\<" + value + "\\>", Arg::type_string, Arg::cat_rx));
|
||||
#else
|
||||
expanded.push_back (Arg ("\\b" + value + "\\b", Arg::type_string, Arg::cat_rx));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
// word --> description ~ word
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue