Skip to content

Commit

Permalink
Call getHomeDir() later, after global constructors
Browse files Browse the repository at this point in the history
This helps getting the directory of the executable
for judging whether we are the portable app or not on windows
  • Loading branch information
chris2511 committed Nov 17, 2021
1 parent 389b459 commit 284b1fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ settings::settings()
defaul["mandatory_dn"] = "";
defaul["explicit_dn"] = "C,ST,L,O,OU,CN,emailAddress";
defaul["string_opt"] = "MASK:0x2002";
defaul["workingdir"] = getHomeDir() + "/";
defaul["workingdir"] = "";
defaul["default_hash"] = digest::getDefault().name();
defaul["ical_expiry"] = "1W";
defaul["cert_expiry"] = "80%";
Expand Down Expand Up @@ -100,6 +100,8 @@ void settings::load_settings()
continue; // Skip non-existing working-dir
if (!value.isEmpty() && !value.endsWith("/"))
value += "/";
if (value.isEmpty())
value = getHomeDir() + "/";
}
db_keys << key; // Key with host ID
setAction(l[0], value); // Key without host ID
Expand Down

0 comments on commit 284b1fa

Please sign in to comment.