From 13663c327fa76b725953eee8617538e8f7a481a2 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 9 Jul 2016 15:12:41 -0400 Subject: [PATCH] CmdShorten: Only validates additions --- src/commands/CmdShorten.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/CmdShorten.cpp b/src/commands/CmdShorten.cpp index 5e2f42ea..d62f48fd 100644 --- a/src/commands/CmdShorten.cpp +++ b/src/commands/CmdShorten.cpp @@ -69,10 +69,11 @@ int CmdShorten ( Duration dur (delta); if (dur < (i.range.end - i.range.start)) { - i.range.end -= dur.toTime_t (); + database.deleteInterval (tracked[tracked.size () - id]); + i.range.end -= dur.toTime_t (); validate (cli, rules, database, i); - database.modifyInterval (tracked[tracked.size () - id], i); + database.addInterval (i); // Feedback. if (rules.getBoolean ("verbose"))