Debian 10: fix loading ~/.my.cnf with MariaDB

The switch to MariaDB Connector/C 3.0 involves some subtle API
changes, including the fact that "~" is not expanded to the user's
home directory anymore.  This change expands the HOME environment
variable within our code base.

Change-Id: I30bc0d4fba6f0c8001832a981aa99af7e6f2a369
This commit is contained in:
Horst Schirmeier
2019-10-22 18:09:05 +02:00
parent 14aba36c6a
commit aec09d1565

View File

@ -20,7 +20,7 @@ Database::Database(const std::string &username, const std::string &host, const s
#endif
CommandLine &cmd = CommandLine::Inst();
std::string db_conf_file = "~/.my.cnf";
std::string db_conf_file = std::string(getenv("HOME")) + "/.my.cnf";
if (cmd[DBDEFAULTS].count()) {
db_conf_file = cmd[DBDEFAULTS].first()->arg;
}