Fix on top of #1677

This commit is contained in:
Felipe Zimmerle
2018-02-26 17:53:18 -03:00
parent f16eb8b54a
commit dca642369e
4 changed files with 9 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ bool IpMatchFromFile::init(const std::string &file,
if (m_param.compare(0, 8, "https://") == 0) {
res = m_tree.addFromUrl(m_param, &e);
} else {
std::string resf = utils::find_resource(m_param, file, error);\
std::string resf = utils::find_resource(m_param, file, error);
if (resf == "") {
return false;
}

View File

@@ -123,7 +123,12 @@ std::list<std::string> expandEnv(const std::string& var, int flags) {
if (wordexp(var.c_str(), &p, flags) == false) {
if (p.we_wordc) {
for (char** exp = p.we_wordv; *exp; ++exp) {
vars.push_back(exp[0]);
std::ifstream *iss = new std::ifstream(exp[0], std::ios::in);
if (iss->is_open()) {
iss->close();
delete iss;
vars.push_back(exp[0]);
}
}
}
wordfree(&p);