diff options
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 178f78bde6da..11c75d2cda4c 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -167,11 +167,10 @@ string baseNameOf(const Path & path) bool isInDir(const Path & path, const Path & dir) { - return dir == "/" - || (path[0] == '/' - && string(path, 0, dir.size()) == dir - && path.size() >= dir.size() + 2 - && path[dir.size()] == '/'); + return path[0] == '/' + && string(path, 0, dir.size()) == dir + && path.size() >= dir.size() + 2 + && path[dir.size()] == '/'; } |