diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/signal.cxx | 62 | ||||
-rw-r--r-- | sal/osl/w32/profile.cxx | 5 |
2 files changed, 31 insertions, 36 deletions
diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx index c97162b1a0ec..d5098a2f4373 100644 --- a/sal/osl/unx/signal.cxx +++ b/sal/osl/unx/signal.cxx @@ -494,46 +494,42 @@ static int ReportCrash( int Signal ) for ( argi = 0; argi < argc; argi++ ) { - if ( osl_Process_E_None == osl_getCommandArg( argi, &ustrCommandArg ) ) + osl_getCommandArg( argi, &ustrCommandArg ); + if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--nocrashreport" ) ) { - if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--nocrashreport" ) ) - { - rtl_uString_release( ustrCommandArg ); - return -1; - } - else if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--autocrashreport" ) ) - { - bAutoCrashReport = true; - } - else if ( 0 == rtl_ustr_ascii_shortenedCompare_WithLength( - rtl_uString_getStr( ustrCommandArg ), rtl_uString_getLength( ustrCommandArg ), - REPORTENV_PARAM, strlen(REPORTENV_PARAM) ) - ) - { - rtl_uString *ustrEnvironment = NULL; - rtl_String *strEnv = NULL; - - rtl_uString_newFromStr( &ustrEnvironment, rtl_uString_getStr( ustrCommandArg ) + strlen(REPORTENV_PARAM) ); + rtl_uString_release( ustrCommandArg ); + return -1; + } + else if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--autocrashreport" ) ) + { + bAutoCrashReport = true; + } + else if ( 0 == rtl_ustr_ascii_shortenedCompare_WithLength( + rtl_uString_getStr( ustrCommandArg ), rtl_uString_getLength( ustrCommandArg ), + REPORTENV_PARAM, strlen(REPORTENV_PARAM) ) + ) + { + rtl_uString *ustrEnvironment = NULL; + rtl_String *strEnv = NULL; - if ( ustrEnvironment ) - { - rtl_uString2String( - &strEnv, - rtl_uString_getStr( ustrEnvironment ), rtl_uString_getLength( ustrEnvironment ), - osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS - ); + rtl_uString_newFromStr( &ustrEnvironment, rtl_uString_getStr( ustrCommandArg ) + strlen(REPORTENV_PARAM) ); - if ( strEnv ) - { - putenv( rtl_string_getStr( strEnv ) ); - rtl_string_release( strEnv ); - } + if ( ustrEnvironment ) + { + rtl_uString2String( + &strEnv, + rtl_uString_getStr( ustrEnvironment ), rtl_uString_getLength( ustrEnvironment ), + osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS + ); - rtl_uString_release( ustrEnvironment ); + if ( strEnv ) + { + putenv( rtl_string_getStr( strEnv ) ); + rtl_string_release( strEnv ); } + rtl_uString_release( ustrEnvironment ); } - } } diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx index 1a0de622b373..43db47f26560 100644 --- a/sal/osl/w32/profile.cxx +++ b/sal/osl/w32/profile.cxx @@ -2204,9 +2204,8 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str for (n = 0; n < nArgs; n++) { rtl_uString * strCommandArg = NULL; - - if ((osl_getCommandArg( n, &strCommandArg ) == osl_Process_E_None) && - ((strCommandArg->buffer[0] == L'-') || (strCommandArg->buffer[0] == L'+')) && + osl_getCommandArg( n, &strCommandArg ); + if (((strCommandArg->buffer[0] == L'-') || (strCommandArg->buffer[0] == L'+')) && (rtl_ustr_ascii_compare_WithLength(strCommandArg->buffer, RTL_CONSTASCII_LENGTH(SVERSION_OPTION), SVERSION_OPTION))) { sal_Unicode *pCommandArg = strCommandArg->buffer + RTL_CONSTASCII_LENGTH(SVERSION_OPTION); |