aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/algorithm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/algorithm.cxx')
-rw-r--r--libbuild2/algorithm.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index 54ddf78..52e0926 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -132,7 +132,14 @@ namespace build2
return nullptr;
if (!n.dir.empty ())
- n.dir.normalize (false, true); // Current dir collapses to an empty one.
+ {
+ // More often than not a non-empty directory will already be normalized.
+ //
+ // Note that we collapse current dir to an empty one.
+ //
+ if (!n.dir.normalized () || n.dir.string () == ".")
+ n.dir.normalize (false, true);
+ }
bool q (cn.qualified ());