mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-07 21:07:20 +02:00
fix home_dir variable definition
This commit is contained in:
parent
4d5d901214
commit
1aa77c9ede
3 changed files with 3 additions and 6 deletions
|
@ -236,16 +236,12 @@ const char* getValue (int argc, const char** argv, std::string arg)
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Static method.
|
// Static method.
|
||||||
bool CLI2::getOverride (int argc, const char** argv, std::string& home, File& rc)
|
bool CLI2::getOverride (int argc, const char** argv, File& rc)
|
||||||
{
|
{
|
||||||
const char* value = getValue (argc, argv, "rc");
|
const char* value = getValue (argc, argv, "rc");
|
||||||
if (value == nullptr)
|
if (value == nullptr)
|
||||||
return false;
|
return false;
|
||||||
rc = File (value);
|
rc = File (value);
|
||||||
if (rc._data.rfind ("/") != std::string::npos)
|
|
||||||
home = rc.parent ();
|
|
||||||
else
|
|
||||||
home = ".";
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class CLI2
|
||||||
public:
|
public:
|
||||||
static int minimumMatchLength;
|
static int minimumMatchLength;
|
||||||
|
|
||||||
static bool getOverride (int, const char**, std::string&, File&);
|
static bool getOverride (int, const char**, File&);
|
||||||
static bool getDataLocation (int, const char**, Path&);
|
static bool getDataLocation (int, const char**, Path&);
|
||||||
static void applyOverrides (int, const char**);
|
static void applyOverrides (int, const char**);
|
||||||
|
|
||||||
|
|
|
@ -440,6 +440,7 @@ int Context::initialize (int argc, const char** argv)
|
||||||
{
|
{
|
||||||
timer_total.start ();
|
timer_total.start ();
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
home_dir = getenv ("HOME");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue