[Libreoffice-commits] core.git: sal/rtl
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 21 06:34:48 UTC 2021
sal/rtl/cmdargs.cxx | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 97351cfe6adcb87ef9076e69312a7208029d6d1a
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Apr 20 16:07:21 2021 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Apr 21 08:34:08 2021 +0200
Simplify some code by using OUString instead of raw rtl_uString
Change-Id: I0d795db2e0fc5f5a74fd8437cac46edaabd1336d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114342
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sal/rtl/cmdargs.cxx b/sal/rtl/cmdargs.cxx
index 8eb328258dfe..bad833077012 100644
--- a/sal/rtl/cmdargs.cxx
+++ b/sal/rtl/cmdargs.cxx
@@ -59,12 +59,14 @@ void init()
{
rtl_uString * pArg = nullptr;
osl_getCommandArg (i, &pArg);
- if ((pArg->buffer[0] == '-' || pArg->buffer[0] == '/') &&
- pArg->buffer[1] == 'e' &&
- pArg->buffer[2] == 'n' &&
- pArg->buffer[3] == 'v' &&
- pArg->buffer[4] == ':' &&
- rtl_ustr_indexOfChar (&(pArg->buffer[5]), '=') >= 0 )
+ bool env;
+ {
+ auto const & arg = OUString::unacquired(&pArg);
+ env = (arg.startsWith("-") || arg.startsWith("/")) &&
+ arg.match("env:", 1) &&
+ arg.indexOf ('=') >= 0;
+ }
+ if (env )
{
// ignore.
rtl_uString_release (pArg);
More information about the Libreoffice-commits
mailing list