diff --git a/AUTHORS b/AUTHORS index c6ba5e50f..37f5c411b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,4 +12,5 @@ With thanks to: Thomas Engel Nishiishii galvanizd + H. İbrahim Güngör diff --git a/ChangeLog b/ChangeLog index 6bf96b6f5..bafdb26d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ represents a feature release, and the Z represents a patch. + Supports relative due: dates (tomorrow, wednesday, 23rd, eom ...) + Bug: Fixed where Esc[0m sequences were being emitted for no good reason + Bug: Fixed underlined table headers when color is turned off + + Bug: Adding a blank priority resulted in an assigned garbage value ------ reality ----------------------------------- diff --git a/html/task.html b/html/task.html index 096fce4fa..0b3bfe31f 100644 --- a/html/task.html +++ b/html/task.html @@ -58,6 +58,7 @@ "23rd", "eom"
  • Fixed bug where Esc[0m sequences were being emitted for no good reason
  • Fixed bug where table headers are underlined when color is turned off +
  • Fixed bug where adding a blank priority resulted in an assigned garbage value

    diff --git a/src/parse.cpp b/src/parse.cpp index 0de8a0dbf..0f88e0c29 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -235,9 +235,7 @@ static bool validAttribute ( else if (name == "priority") { - for (std::string::iterator i = value.begin (); i != value.end (); ++i) - *i = ::toupper (*i); - + value = upperCase (value); return validPriority (value); } @@ -248,7 +246,7 @@ static bool validAttribute ( name == "base" || name == "range") throw std::string ("\"") + - name + + name + "\" is not an attribute you may modify directly."; return true; diff --git a/src/task.cpp b/src/task.cpp index dc023209f..ee0a9e218 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -403,6 +403,14 @@ void handleAdd (const TDB& tdb, T& task, Config& conf) sprintf (entryTime, "%u", (unsigned int) time (NULL)); task.setAttribute ("entry", entryTime); + std::map atts; + task.getAttributes (atts); + foreach (i, atts) + { + if (i->second == "") + task.removeAttribute (i->first); + } + if (task.getAttribute ("recur") != "") decorateRecurringTask (task); diff --git a/src/task.h b/src/task.h index 6d529ed50..b2a8754e4 100644 --- a/src/task.h +++ b/src/task.h @@ -102,6 +102,7 @@ void split (std::vector&, const std::string&, const std::string&); void join (std::string&, const std::string&, const std::vector&); std::string commify (const std::string&); std::string lowerCase (const std::string&); +std::string upperCase (const std::string&); void delay (float); int autoComplete (const std::string&, const std::vector&, std::vector&); void formatTimeDeltaDays (std::string&, time_t); diff --git a/src/text.cpp b/src/text.cpp index 50a497cb9..066d84f86 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -285,6 +285,17 @@ std::string lowerCase (const std::string& input) return output; } +//////////////////////////////////////////////////////////////////////////////// +std::string upperCase (const std::string& input) +{ + std::string output = input; + for (int i = 0; i < (int) input.length (); ++i) + if (::isupper (input[i])) + output[i] = ::toupper (input[i]); + + return output; +} + //////////////////////////////////////////////////////////////////////////////// const char* optionalBlankLine (Config& conf) {