summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-10-08 20:34:58 +0300
committerTor Lillqvist <tml@collabora.com>2013-10-08 20:39:10 +0300
commit261f1439e5516f6d60317a675d261af330a9a74c (patch)
tree37a37ff5c3892445d7fbc5558f6ee4dee855a089 /sal
parent0ef3218911ee843c0b2eb639669050d2dc056def (diff)
Don't ignore -env: command line parameters in some cases
Happened at least in the experimental iOS app. Change-Id: I725dde2f40ae9e64406e7a1b1dd5dc0da0a9ebd4
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/bootstrap.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index a4169b3b66b9..5ee61b0a19ba 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -199,9 +199,18 @@ static sal_Bool getFromCommandLineArgs(
}
rtl_uString_release( pArg );
}
- pNameValueList = &nameValueList;
+ // If osl_setCommandArgs() has not been called yet (for
+ // instance, if this gets called from a static initialiser),
+ // don't initialise pNameValueList, as that would cause the
+ // code to ignore any -env:FOO=BAR on the command line once
+ // osl is told about it.
+ if( nArgCount > 0 )
+ pNameValueList = &nameValueList;
}
+ if( ! pNameValueList )
+ return sal_False;
+
sal_Bool found = sal_False;
for( NameValueList::iterator ii = pNameValueList->begin() ;