diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-10-20 16:31:20 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-10-20 23:04:11 +0200 |
commit | 10ce581cfc7a3fd74200910291a0fb916180e772 (patch) | |
tree | c2668b7c47347c9301058bec499b002e6751fa96 /sal | |
parent | Undo basis/brand split: moved ini files from basis program/ to brand program/. (diff) | |
download | core-10ce581cfc7a3fd74200910291a0fb916180e772.tar.gz core-10ce581cfc7a3fd74200910291a0fb916180e772.zip |
osl_getCommandArgCount can be called w/o prior osl_setCommandArgs.
...e.g., with "import uno" in a stand-alone pyhton process (where it
is hopefully harmless that UNO does not get access to any -env
command line args).
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/process_impl.cxx | 6 | ||||
-rw-r--r-- | sal/osl/w32/process.cxx | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index a41bc6889dd8..003e136268e3 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -206,7 +206,11 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount (void) sal_uInt32 result = 0; pthread_mutex_lock (&(g_command_args.m_mutex)); - OSL_ASSERT(g_command_args.m_nCount > 0); + if (g_command_args.m_nCount == 0) { + OSL_TRACE( + OSL_LOG_PREFIX + "osl_getCommandArgCount w/o prior call to osl_setCommandArgs"); + } if (g_command_args.m_nCount > 0) result = g_command_args.m_nCount - 1; pthread_mutex_unlock (&(g_command_args.m_mutex)); diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 718f293cac1b..18eecabc3cd4 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -343,7 +343,11 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount(void) sal_uInt32 result = 0; osl_acquireMutex (*osl_getGlobalMutex()); - OSL_ASSERT(g_command_args.m_nCount > 0); + if (g_command_args.m_nCount == 0) { + OSL_TRACE( + OSL_LOG_PREFIX + "osl_getCommandArgCount w/o prior call to osl_setCommandArgs"); + } if (g_command_args.m_nCount > 0) { /* We're not counting argv[0] here. */ |