diff --git a/src/TDB.cpp b/src/TDB.cpp index ba0de0f27..41e75b340 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -181,7 +181,6 @@ int TDB::loadPending (std::vector & tasks, Filter& filter) if (length > 1) { // TODO Add hidden attribute indicating source? - line[length - 1] = '\0'; // Kill \n Task task (line); task.id = mId++; diff --git a/src/Task.cpp b/src/Task.cpp index 3da4002ec..50e3da78c 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -125,14 +125,20 @@ void Task::setStatus (Task::status status) //////////////////////////////////////////////////////////////////////////////// void Task::parse (const std::string& line) { + std::string copy; + if (line[line.length () - 1] == '\n') + copy = line.substr (0, line.length () - 1); + else + copy = line; + try { - Record::parse (line); + Record::parse (copy); } catch (std::string& e) { - legacyParse (line); + legacyParse (copy); } }