diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-15 09:18:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-15 09:18:54 +0200 |
commit | 05c5e65dc69bdda66b9b73a10a107b901abf3bc3 (patch) | |
tree | db72eb67a2c9851f4dc14b672b91ab928fb3c358 | |
parent | f303ec225c294c695711bead8310d3a7b23baade (diff) |
Fix bug in bin.lib.suffix handling
-rw-r--r-- | build2/cc/link-rule.cxx | 32 |
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. |