Bug #1017
- Fixed bug #1017, which exported invalid JSON when there were no tasks (thanks to Nicholas Rabenau).
This commit is contained in:
@@ -78,6 +78,8 @@ Bugs
|
|||||||
Bryan Kam).
|
Bryan Kam).
|
||||||
+ Fixed bug #1016, which caused segfaults when importing JSON with annotations
|
+ Fixed bug #1016, which caused segfaults when importing JSON with annotations
|
||||||
that lack description or entry date (thanks to Nicholas Rabenau).
|
that lack description or entry date (thanks to Nicholas Rabenau).
|
||||||
|
+ Fixed bug #1017, which exported invalid JSON when there were no tasks (thanks
|
||||||
|
to Nicholas Rabenau).
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -53,12 +53,6 @@ int CmdExport::execute (std::string& output)
|
|||||||
std::vector <Task> filtered;
|
std::vector <Task> filtered;
|
||||||
filter (filtered);
|
filter (filtered);
|
||||||
|
|
||||||
if (filtered.size () == 0)
|
|
||||||
{
|
|
||||||
context.footnote (STRING_FEEDBACK_NO_MATCH);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: "limit:" feature not supported.
|
// Note: "limit:" feature not supported.
|
||||||
// TODO Why not?
|
// TODO Why not?
|
||||||
|
|
||||||
@@ -72,16 +66,17 @@ int CmdExport::execute (std::string& output)
|
|||||||
std::vector <Task>::iterator task;
|
std::vector <Task>::iterator task;
|
||||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||||
{
|
{
|
||||||
if (task != filtered.begin ())
|
|
||||||
output += ",\n";
|
|
||||||
|
|
||||||
output += task->composeJSON (true);
|
output += task->composeJSON (true);
|
||||||
|
|
||||||
|
if (task != filtered.begin ())
|
||||||
|
output += ",";
|
||||||
|
|
||||||
|
output += "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json_array)
|
if (json_array)
|
||||||
output += "\n]";
|
output += "]\n";
|
||||||
|
|
||||||
output += "\n";
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user