mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 09:53:08 +02:00
- Fixed bug whereby adding a new task with "task add asdfsd pri:" resulted in gibberish values in the priority field.
This commit is contained in:
parent
188b9f36f2
commit
e85d36cea0
7 changed files with 25 additions and 4 deletions
1
AUTHORS
1
AUTHORS
|
@ -12,4 +12,5 @@ With thanks to:
|
|||
Thomas Engel
|
||||
Nishiishii
|
||||
galvanizd
|
||||
H. İbrahim Güngör
|
||||
|
||||
|
|
|
@ -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 -----------------------------------
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
"23rd", "eom"
|
||||
<li>Fixed bug where Esc[0m sequences were being emitted for no good reason
|
||||
<li>Fixed bug where table headers are underlined when color is turned off
|
||||
<li>Fixed bug where adding a blank priority resulted in an assigned garbage value
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 <std::string, std::string> atts;
|
||||
task.getAttributes (atts);
|
||||
foreach (i, atts)
|
||||
{
|
||||
if (i->second == "")
|
||||
task.removeAttribute (i->first);
|
||||
}
|
||||
|
||||
if (task.getAttribute ("recur") != "")
|
||||
decorateRecurringTask (task);
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ void split (std::vector<std::string>&, const std::string&, const std::string&);
|
|||
void join (std::string&, const std::string&, const std::vector<std::string>&);
|
||||
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::string>&, std::vector<std::string>&);
|
||||
void formatTimeDeltaDays (std::string&, time_t);
|
||||
|
|
11
src/text.cpp
11
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue