diff options
author | Jude Taylor <me@jude.bio> | 2015-09-29 09:03:45 -0700 |
---|---|---|
committer | Jude Taylor <me@jude.bio> | 2015-10-21 12:38:52 -0700 |
commit | e770f941d612922a19fae0dd7552a47a64751c42 (patch) | |
tree | 6c0370484f15e38683822279b4849f50094e67a0 /src/libutil/util.cc | |
parent | 6dbc9e02ecc649f6739dac3a87381223e96f5e75 (diff) |
make sandbox builds more permissive
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r-- | src/libutil/util.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 11c75d2cd..178f78bde 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -167,10 +167,11 @@ string baseNameOf(const Path & path) bool isInDir(const Path & path, const Path & dir) { - return path[0] == '/' - && string(path, 0, dir.size()) == dir - && path.size() >= dir.size() + 2 - && path[dir.size()] == '/'; + return dir == "/" + || (path[0] == '/' + && string(path, 0, dir.size()) == dir + && path.size() >= dir.size() + 2 + && path[dir.size()] == '/'); } |