From b02c11be0e6d9da266b99e17786b3e8840055a17 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 12 Jul 2009 14:27:26 -0400 Subject: [PATCH] Bug Fix - #203 - Zero-length command line project was being compared to a zero-length truncated task project, and always matching. Thanks to John Florian. --- src/Context.cpp | 10 +++++++++- src/main.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 6bdab5181..f2012f4b5 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -670,8 +670,16 @@ void Context::autoFilter (Task& t, Filter& f) // Projects are matched left-most. else if (att->first == "project" && att->second.mod () == "") { - f.push_back (Att ("project", "startswith", att->second.value ())); + if (att->second.value () != "") + { + f.push_back (Att ("project", "startswith", att->second.value ())); debug ("auto filter: " + att->first + ".startswith:" + att->second.value ()); + } + else + { + f.push_back (Att ("project", "is", att->second.value ())); + debug ("auto filter: " + att->first + ".is:" + att->second.value ()); + } } // The limit attribute does not participate in filtering, and needs to be diff --git a/src/main.h b/src/main.h index 8735c5e7d..f049738b8 100644 --- a/src/main.h +++ b/src/main.h @@ -30,7 +30,7 @@ #define FEATURE_TDB_OPT 1 // TDB Optimization reduces file I/O. #define FEATURE_NEW_ID 1 // Echoes back new id. #define FEATURE_SHELL 1 // Interactive shell. -#define FEATURE_NCURSES_COLS 1 // Shortcut that avoids WINDOW. +#define FEATURE_NCURSES_COLS 1 // Shortcut that avoids WINDOW. #include #include