diff --git a/AUTHORS b/AUTHORS index 8788e1495..39982c5d1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -164,3 +164,5 @@ suggestions: Tim None trHD Benjamin Weber + alparo + diff --git a/ChangeLog b/ChangeLog index 4bf3fb6a9..e32f5ba98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/NEWS b/NEWS index f0d245791..3f595bdb7 100644 --- a/NEWS +++ b/NEWS @@ -19,7 +19,8 @@ New commands in taskwarrior 2.2.0 New configuration options in taskwarrior 2.2.0 - New color rule 'color.uda.'. - + 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 diff --git a/src/Config.cpp b/src/Config.cpp index 93689d3a6..39e2164f0 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -31,12 +31,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include diff --git a/src/Context.cpp b/src/Context.cpp index 4ef958691..944822ba7 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -579,18 +578,8 @@ const std::vector 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 (); */ diff --git a/src/Path.cpp b/src/Path.cpp index 34b67632a..1defe4029 100644 --- a/src/Path.cpp +++ b/src/Path.cpp @@ -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; } diff --git a/src/Path.h b/src/Path.h index 117ecc7af..8a7951779 100644 --- a/src/Path.h +++ b/src/Path.h @@ -61,6 +61,7 @@ public: static std::vector glob (const std::string&); public: + std::string _original; std::string _data; };