From 4f4a04738ffdbb898063ce719d8b89ccc1f80aa4 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 22 Apr 2011 00:03:45 -0400 Subject: [PATCH] Bug #745 - Fixed Bug #745, which allows projects names with spaces, provided the values are quoted (thanks to Duane Waddle). - Added unit test. --- ChangeLog | 4 ++++ NEWS | 1 + src/Att.cpp | 7 ------- test/project.t | 6 +++++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac831ee9f..6086f8af6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,6 +42,10 @@ truncated to a page. + Fixed Bug #732, which fixes misleading messages and documentation for merge/push/pull URIs (thanks to Tomas Cech). + + Fixed Bug #745, which allows projects names with spaces, provided the values + are quoted (thanks to Duane Waddle). + + Applied patch for Bug #746, which added missing documentation for the 'entry' + report column (thanks to Duane Waddle). # Untracked Bugs, biggest first. diff --git a/NEWS b/NEWS index f8ed52e70..91bd36a26 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ New Features in taskwarrior 2.0.0 - Attribute modifiers may be prefixed with '~' to return the opposite of a filter's results. - Status attribute can now be used in report. + - Project names may now contain spaces. Please refer to the ChangeLog file for full details. There are too many to list here. diff --git a/src/Att.cpp b/src/Att.cpp index c5a33a16f..9ca88cb98 100644 --- a/src/Att.cpp +++ b/src/Att.cpp @@ -355,13 +355,6 @@ bool Att::validNameValue ( name + "\" is not an attribute you may modify directly."; - // Thirdly, make sure the value has the expected form or values. - if (name == "project") - { - if (!noSpaces (value)) - throw std::string ("The '") + name + "' attribute may not contain spaces."; - } - else if (name == "priority") { if (value != "") diff --git a/test/project.t b/test/project.t index abdde9cd9..50cae06a8 100755 --- a/test/project.t +++ b/test/project.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 14; # Create the rc file. if (open my $fh, '>', 'pro.rc') @@ -62,6 +62,10 @@ $output = qx{../src/task rc:pro.rc 3 pro:bar}; like ($output, qr/The project 'foo' has changed\. Project 'foo' is 50% complete \(1 of 2 tasks remaining\)\./, 'change project'); like ($output, qr/The project 'bar' has changed\. Project 'bar' is 0% complete \(1 of 1 tasks remaining\)\./, 'change project'); +# Test projects with spaces in them. +$output = qx{../src/task rc:pro.rc 3 pro:"foo bar"}; +like ($output, qr/The project 'foo bar' has changed\./, 'project with spaces'); + # Cleanup. unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data');