From 2f10e8d2e2b4bc266ac5fa115a557ca205f8d698 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 16 Sep 2012 14:57:07 -0400 Subject: [PATCH] Bug #1083 - Partially fixed #1083, which showed 'task 0 ...' when modifying a non- pending task (thanks to Aikido Guy). --- ChangeLog | 2 ++ src/commands/CmdModify.cpp | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b60b9a91..7d3a4c577 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,8 @@ Bugs provides an incorrect summary. + Fixed bug #1048, which segfaulted rather than complain about syntax (thanks to Bryce Harrington, Štěpán Henek). + + Partially fixed #1083, which showed 'task 0 ...' when modifying a non- + pending task (thanks to Aikido Guy). ------ old releases ------------------------------ diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index d17adc956..b1fa93e13 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -95,9 +95,15 @@ int CmdModify::execute (std::string& output) throw std::string (STRING_CMD_MODIFY_REC_ALWAYS); // Delete the specified task. - std::string question = format (STRING_CMD_MODIFY_CONFIRM, - task->id, - task->get ("description")); + std::string question; + if (task->id != 0) + question = format (STRING_CMD_MODIFY_CONFIRM, + task->id, + task->get ("description")); + else + question = format (STRING_CMD_MODIFY_CONFIRM, + task->get ("uuid"), + task->get ("description")); if (permission (*task, taskDifferences (before, *task) + question, filtered.size ())) {