aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-05-19 11:10:43 +0200
committerGitHub <noreply@github.com>2021-05-19 11:10:43 +0200
commit7234cf39be85db13394aa86e37a042f1a06b74d3 (patch)
tree8a0b97334936051060b01e8c4a2a3497e2804396 /src
parent57f321f3ce311228ad9ab7eac8b108aeb4fa4026 (diff)
parent3d90ab9345ea1379fa3aea2a26f8eaa498f3e3d0 (diff)
Merge pull request #4831 from matthewbauer/fix-extra-slash-in-canon-path
Fix extra slash in canonPath output
Diffstat (limited to 'src')
-rw-r--r--src/libutil/util.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 5f597bf06..7e57fd7ca 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -155,6 +155,9 @@ Path canonPath(const Path & path, bool resolveSymlinks)
s.clear(); /* restart for symlinks pointing to absolute path */
} else {
s = dirOf(s);
+ if (s == "/") { // we don’t want trailing slashes here, which dirOf only produces if s = /
+ s.clear();
+ }
}
}
}