summaryrefslogtreecommitdiff
path: root/pyuno/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-10-10 13:47:18 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-10 14:38:38 +0200
commit1acaa577b67158c060d2f57414f7aea86504a489 (patch)
tree30ac01bdf0a5b054d1e2a8d0171fe222d585b39b /pyuno/source
parentefbf0b412bc76149b410d0cd17c7040513d4c203 (diff)
sal: add special handling of argc==0 to osl_setCommandArgs()
... to set up a fake command line. This is used from pyuno, when invoked from the "python" executable as "import uno". On WNT there is an API to get the actual command line, so just use that even in the "fake" case; on UNX just fake something up. Just for the record the whole osl_setCommandArgs() is called exactly once assumption should work out _unless_ there is a program that uses SAL_MAIN _and_ does a python-level "import uno" _before_ it wants to create a python-based UNO service (via pyuno_loader::CreateInstance), since pyuno already takes care to call Runtime::initialize() at most once. Change-Id: Ifd23de733ea3e6b694d46ab039b6aa4fd3e7fc1b Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'pyuno/source')
-rw-r--r--pyuno/source/module/pyuno_module.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index e34b675837c7..718759f4e88f 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -263,10 +263,7 @@ static PyObject* getComponentContext(
{
// cppu::defaultBootstrap_InitialComponentContext expects
// command line arguments to be present
- static char * argv [1];
- argv[0] = strdup(
- "this is just a fake and cheap imitation of a command line");
- osl_setCommandArgs(1, argv);
+ osl_setCommandArgs(0, 0); // fake it
OUString iniFile;
if( path.isEmpty() )