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

@@ -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);