aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/cc/link-rule.cxx32
1 files changed, 13 insertions, 19 deletions
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index f2ee33f..5ca7865 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -370,28 +370,22 @@ namespace build2
// We start with the basic path.
//
path b (ls.dir);
- path cp; // Clean pattern.
- {
- if (pfx == nullptr || pfx[0] == '\0')
- {
- b /= ls.name;
- }
- else
- {
- b /= pfx;
- b += ls.name;
- }
-
- cp = b;
- cp += "?*"; // Don't match empty (like the libfoo.so symlink).
- if (sfx != nullptr)
- {
- b += sfx;
- cp += sfx;
- }
+ if (pfx != nullptr && pfx[0] != '\0')
+ {
+ b /= pfx;
+ b += ls.name;
}
+ else
+ b /= ls.name;
+
+ if (sfx != nullptr && sfx[0] != '\0')
+ b += sfx;
+ // Clean pattern.
+ //
+ path cp (b);
+ cp += "?*"; // Don't match empty (like the libfoo.so symlink).
append_ext (cp);
// On Windows the real path is to libs{} and the link path is empty.