diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-13 15:59:33 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-11-16 18:50:15 +0100 |
commit | 676fb8497383758e8f8730841d83d5a24e214629 (patch) | |
tree | 2a7ce3b73619c3b5b53284c35efd5b184fc60241 | |
parent | c9bb754c44812968e18ca81e338669c3c6e385fa (diff) |
Bogus assert
implementation can indeed be empty when cppu::writeSharedLibComponentInfo calls
getEnvironmentFromModule(mod, curEnv, "", ""), which in the final if-branch
calls getEnvironment with implementation = "". Happens when adding desktop/qa's
test-active.oxt. Regression introduced with
ae3a0c8da50b36db395984637f5ad74d3b4887bc "Add .component <implementation
constructor='...' feature."
(cherry picked from commit 97464be9808c0d349be8b84fea6973527496bf26)
Conflicts:
cppuhelper/source/shlib.cxx
Change-Id: Ia70958e4aa18d378ff35063bdf6187f6e073b765
Reviewed-on: https://gerrit.libreoffice.org/19956
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 2466c85c001761da6979e0e1b3a0b15d4b2bdd32)
-rw-r--r-- | cppuhelper/source/shlib.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index 258e9cbdb557..a87071e812c2 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -40,17 +40,19 @@ css::uno::Environment cppuhelper::detail::getEnvironment( rtl::OUString const & name, rtl::OUString const & implementation) { - assert(!implementation.isEmpty()); rtl::OUString n(name); - static char const * log = std::getenv("UNO_ENV_LOG"); - if (log != 0 && *log != 0) { - rtl::OString imps(log); - for (sal_Int32 i = 0; i != -1;) { - rtl::OString imp(imps.getToken(0, ';', i)); - //TODO: this assumes UNO_ENV_LOG only contains ASCII characters: - if (implementation.equalsAsciiL(imp.getStr(), imp.getLength())) { - n += ":log"; - break; + if (!implementation.isEmpty()) { + static char const * log = std::getenv("UNO_ENV_LOG"); + if (log != 0 && *log != 0) { + rtl::OString imps(log); + for (sal_Int32 i = 0; i != -1;) { + rtl::OString imp(imps.getToken(0, ';', i)); + //TODO: this assumes UNO_ENV_LOG only contains ASCII characters: + if (implementation.equalsAsciiL(imp.getStr(), imp.getLength())) + { + n += ":log"; + break; + } } } } |