From 05c5e65dc69bdda66b9b73a10a107b901abf3bc3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 15 Aug 2019 09:18:54 +0200 Subject: Fix bug in bin.lib.suffix handling --- build2/cc/link-rule.cxx | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'build2/cc/link-rule.cxx') 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. -- cgit v1.1