- Fixed bug #1017, which exported invalid JSON when there were no tasks (thanks
  to Nicholas Rabenau).
This commit is contained in:
Paul Beckingham 2012-06-10 15:21:55 -04:00
parent 128b139b17
commit 180ff95649
2 changed files with 8 additions and 11 deletions

View file

@ -53,12 +53,6 @@ int CmdExport::execute (std::string& output)
std::vector <Task> filtered;
filter (filtered);
if (filtered.size () == 0)
{
context.footnote (STRING_FEEDBACK_NO_MATCH);
return 1;
}
// Note: "limit:" feature not supported.
// TODO Why not?
@ -72,16 +66,17 @@ int CmdExport::execute (std::string& output)
std::vector <Task>::iterator task;
for (task = filtered.begin (); task != filtered.end (); ++task)
{
if (task != filtered.begin ())
output += ",\n";
output += task->composeJSON (true);
if (task != filtered.begin ())
output += ",";
output += "\n";
}
if (json_array)
output += "\n]";
output += "]\n";
output += "\n";
return rc;
}