diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2011-08-06T18·45+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2011-08-06T18·45+0000 |
commit | 9d091ee99a9b962c72b3cb9485a89ba028dd1155 (patch) | |
tree | c8085f53e8d3620f7971be69c308cdf8ed7f6d36 | |
parent | 00a724ebc6f049009ce0810b0ac44dd11199d88b (diff) |
* Handle the case where the search path element is a regular file.
-rw-r--r-- | src/libexpr/parser.y | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index e54f6fe0a7b5..449123a1f82c 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -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); } |