- Fixed bug #642, so that the default 'data.location=~/.task' preserves the
  '~', leading to more portable .taskrc files (thanks to alparo).
This commit is contained in:
Paul Beckingham 2013-02-10 17:59:33 -05:00
parent b6c28ecb7a
commit aca76da3e5
7 changed files with 20 additions and 20 deletions

View file

@ -164,3 +164,5 @@ suggestions:
Tim None
trHD
Benjamin Weber
alparo

View file

@ -37,6 +37,8 @@ Features
+ Added the configuration variable 'print.empty.columns'.
Bugs
+ Fixed bug #642, so that the default 'data.location=~/.task' preserves the
'~', leading to more portable .taskrc files (thanks to alparo).
+ Fixed bug #947, #1031, which kept expanding aliases after the '--' operator
(thanks to Jim B).
+ Fixed bug #1038, which prints blank lines with bulk changes and when the

3
NEWS
View file

@ -19,7 +19,8 @@ New commands in taskwarrior 2.2.0
New configuration options in taskwarrior 2.2.0
- New color rule 'color.uda.<uda-name>'.
+ Added the configuration variable 'print.empty.columns'.
- Added the configuration variable 'print.empty.columns'.
- Any ~ characters in a default .taskrc file are preserved.
Newly deprecated features in taskwarrior 2.2.0

View file

@ -31,12 +31,10 @@
#include <fstream>
#include <sstream>
#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
#include <inttypes.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
#include <Directory.h>
#include <Date.h>
#include <File.h>

View file

@ -32,7 +32,6 @@
#include <sstream>
#include <algorithm>
#include <assert.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@ -579,18 +578,8 @@ const std::vector <std::string> Context::getCommands () const
////////////////////////////////////////////////////////////////////////////////
void Context::assumeLocations ()
{
// Note that this pointer is deliberately not free()'d, even though valgrind
// complains about it. It is either not necessary, or forbidden, depending
// on OS.
// Set up default locations.
struct passwd* pw = getpwuid (getuid ());
if (!pw)
throw std::string (STRING_NO_HOME);
home_dir = pw->pw_dir;
rc_file = File (home_dir + "/.taskrc");
data_dir = Directory (home_dir + "/.task");
rc_file = File ("~/.taskrc");
data_dir = Directory ("~/.task");
}
////////////////////////////////////////////////////////////////////////////////
@ -603,14 +592,14 @@ void Context::createDefaultConfig ()
!confirm (format (STRING_CONTEXT_CREATE_RC, home_dir, rc_file._data)))
throw std::string (STRING_CONTEXT_NEED_RC);
config.createDefaultRC (rc_file, data_dir);
config.createDefaultRC (rc_file, data_dir._original);
}
// Create data location, if necessary.
config.createDefaultData (data_dir);
// Create extension directory, if necessary.
/* TODO Enable this when the time is right, say for 2.1
/* TODO Enable this when the time is right, say for 2.4
if (! extension_dir.exists ())
extension_dir.create ();
*/

View file

@ -53,12 +53,16 @@ Path::Path ()
Path::Path (const Path& other)
{
if (this != &other)
_data = other._data;
{
_original = other._original;
_data = other._data;
}
}
////////////////////////////////////////////////////////////////////////////////
Path::Path (const std::string& in)
{
_original = in;
_data = expand (in);
}
@ -71,7 +75,10 @@ Path::~Path ()
Path& Path::operator= (const Path& other)
{
if (this != &other)
this->_data = other._data;
{
this->_original = other._original;
this->_data = other._data;
}
return *this;
}

View file

@ -61,6 +61,7 @@ public:
static std::vector<std::string> glob (const std::string&);
public:
std::string _original;
std::string _data;
};