From 9996e5adef6cb66fa8bee1d3f351245faf3c4d97 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 9 Aug 2014 20:19:02 -0400 Subject: [PATCH] Hooks - Correct handling for JSON and non-JSON output. --- src/Hooks.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Hooks.cpp b/src/Hooks.cpp index ce89774e4..1a757b7d2 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -112,7 +112,10 @@ void Hooks::onLaunch () else { for (line = lines.begin (); line != lines.end (); ++line) - context.error (*line); + if (line->length () && (*line)[0] == '{') + ; // Ignored + else + context.error (*line); throw 0; // This is how hooks silently terminate processing. } @@ -162,7 +165,10 @@ void Hooks::onExit () else { for (line = lines.begin (); line != lines.end (); ++line) - context.error (*line); + if (line->length () && (*line)[0] == '{') + ; // Ignored + else + context.error (*line); } } @@ -225,7 +231,12 @@ void Hooks::onAdd (Task& after) else { for (line = lines.begin (); line != lines.end (); ++line) - context.error (*line); + { + if (line->length () && (*line)[0] == '{') + ; // Ignored + else + context.error (*line); + } throw 0; // This is how hooks silently terminate processing. } @@ -294,7 +305,10 @@ void Hooks::onModify (const Task& before, Task& after) else { for (line = lines.begin (); line != lines.end (); ++line) - context.error (*line); + if (line->length () && (*line)[0] == '{') + ; // Ignored + else + context.error (*line); throw 0; // This is how hooks silently terminate processing. }