summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-04-20 16:07:21 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-04-21 08:34:08 +0200
commit97351cfe6adcb87ef9076e69312a7208029d6d1a (patch)
treee15f47bd61b868d710a825138d6c41ce12be018b /sal
parent6e62c9df969fdf3a599e4f7b0e46a70e8f0780e5 (diff)
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@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/cmdargs.cxx14
1 files changed, 8 insertions, 6 deletions
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);