* Handle the case where the search path element is a regular file.

This commit is contained in:
Eelco Dolstra 2011-08-06 18:45:28 +00:00
parent 00a724ebc6
commit 9d091ee99a

View file

@ -558,7 +558,8 @@ Path EvalState::findFile(const string & path)
if (path.compare(0, i->first.size(), i->first) != 0 ||
(path.size() > i->first.size() && path[i->first.size()] != '/'))
continue;
res = i->second + "/" + string(path, i->first.size());
res = i->second +
(path.size() == i->first.size() ? "" : "/" + string(path, i->first.size()));
}
if (pathExists(res)) return canonPath(res);
}