Task Data Parsing

- Improved the handling when parsing blank lines and empty task in the data, so
  that instead of the message:

    Taskwarrior no longer supports file format 1, originally used between 27
    November 2006 and 31 December 2007.

  We now see:

    Unrecognized Taskwarrior file format or blank line in data.

- Merged t2.t.cpp into t.t.cpp.
This commit is contained in:
Paul Beckingham
2015-10-23 10:13:38 -04:00
parent 603843821b
commit bb58b796fd
8 changed files with 73 additions and 125 deletions

View File

@@ -1676,10 +1676,10 @@ int Task::determineVersion (const std::string& line)
// X [tags] [attributes] description\n
//
// Scan for the first character being either the bracket or X.
else if (line.find ("X [") == 0 ||
line.find ("uuid") == std::string::npos ||
(line[0] == '[' &&
line.substr (line.length () - 1, 1) != "]"))
else if (line.find ("X [") == 0 ||
(line[0] == '[' &&
line.substr (line.length () - 1, 1) != "]" &&
line.length () > 3))
return 1;
// Version 5?