fix home_dir variable definition

This commit is contained in:
Julien Rabinow 2020-12-03 01:29:36 -08:00 committed by Tomas Babej
parent 4d5d901214
commit 1aa77c9ede
3 changed files with 3 additions and 6 deletions

View file

@ -236,16 +236,12 @@ const char* getValue (int argc, const char** argv, std::string arg)
////////////////////////////////////////////////////////////////////////////////
// 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");
if (value == nullptr)
return false;
rc = File (value);
if (rc._data.rfind ("/") != std::string::npos)
home = rc.parent ();
else
home = ".";
return true;
}

View file

@ -60,7 +60,7 @@ class CLI2
public:
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 void applyOverrides (int, const char**);

View file

@ -440,6 +440,7 @@ int Context::initialize (int argc, const char** argv)
{
timer_total.start ();
int rc = 0;
home_dir = getenv ("HOME");
try
{