diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-14 08:50:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-06 13:51:06 +0200 |
commit | bd17c9c9495f555ea27f7debfabeb2407ac2b9b6 (patch) | |
tree | 354bb11636e1b14cc29d061ddaa8be95ba09bb4c /l10ntools | |
parent | d5673ec3f8b17d57857c75916186c681d66cf243 (diff) |
loplugin:stringadd also check O[U]StringBuffers
For similar code sequences that can be improved.
Also move containsComment from collapseif plugin code to
plugin.cxx so we can use it from stringadd.
Change-Id: Ie07d9aedf2c31cb0b2080e1b8584294d7046a8e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149217
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/localize.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 96037c991927..eb8d5b00cb11 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -104,8 +104,7 @@ void handleCommand( #endif auto const env = getenv("SRC_ROOT"); assert(env != nullptr); - buf.append(env); - buf.append("/solenv/bin/"); + buf.append(OString::Concat(env) + "/solenv/bin/"); } else { @@ -116,19 +115,14 @@ void handleCommand( #endif auto const env = getenv("WORKDIR_FOR_BUILD"); assert(env != nullptr); - buf.append(env); - buf.append("/LinkTarget/Executable/"); + buf.append(OString::Concat(env) + "/LinkTarget/Executable/"); } - buf.append(rExecutable.data()); - buf.append(" -i "); - buf.append(rInPath); - buf.append(" -o "); - buf.append(rOutPath); - - const OString cmd = buf.makeStringAndClear(); - if (system(cmd.getStr()) != 0) + buf.append(OString::Concat(std::string_view(rExecutable)) + + " -i " + rInPath + " -o " + rOutPath); + + if (system(buf.getStr()) != 0) { - std::cerr << "Error: Failed to execute " << cmd << '\n'; + std::cerr << "Error: Failed to execute " << buf.getStr() << '\n'; throw false; //TODO } } |