From cf4416a68fb68f36cf9065c6d08d14dd22637b24 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 29 Feb 2012 11:46:12 +0100 Subject: fdo#46434: No need to turn arguments into absolute file URLs when sending ...as the receiving side already takes care of that (using the cwd that is sent first). --- desktop/unx/source/start.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'desktop') diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index be3ac7e1ca3b..773c9d0fcd37 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -450,7 +450,6 @@ send_args( int fd, rtl_uString *pCwdPath ) sal_Bool bResult; size_t nLen; rtl_uString *pEscapedCwdPath = escape_path( pCwdPath ); - sal_Bool bDontConvertNext = sal_False; sal_uInt32 nArg = 0; sal_uInt32 nArgCount = osl_getCommandArgCount(); @@ -485,44 +484,6 @@ send_args( int fd, rtl_uString *pCwdPath ) osl_getCommandArg( nArg, &pTmp ); - // this is not a param, we have to prepend filenames with file:// - // FIXME: improve the check - if ( ( pTmp->buffer[0] != (sal_Unicode)'-' ) ) - { - sal_Int32 nFirstColon = rtl_ustr_indexOfChar_WithLength( pTmp->buffer, pTmp->length, ':' ); - sal_Int32 nFirstSlash = rtl_ustr_indexOfChar_WithLength( pTmp->buffer, pTmp->length, '/' ); - - // check that pTmp is not an URI yet - // note ".uno" ".slot" & "vnd.sun.star.script" are special urls that - // don't expect a following '/' - - const char* schemes[] = { "slot:", ".uno:", "vnd.sun.star.script:" }; - sal_Bool bIsSpecialURL = sal_False; - int i = 0; - int len = SAL_N_ELEMENTS(schemes); - for ( ; i < len; ++i ) - { - if ( rtl_ustr_indexOfAscii_WithLength( pTmp->buffer - , pTmp->length , schemes[ i ], strlen(schemes[ i ] )) == 0 ) - { - bIsSpecialURL = sal_True; - break; - } - } - - if ( !bIsSpecialURL && ( nFirstColon < 1 || ( nFirstSlash != nFirstColon + 1 ) ) ) - { - // some of the switches (currently just -pt) don't want to - // have the filenames as URIs - if ( !bDontConvertNext ) - osl_getAbsoluteFileURL( pCwdPath, pTmp, &pTmp ); - } - } - - // don't convert filenames with some of the switches - // (currently just -pt) - bDontConvertNext = !rtl_ustr_ascii_compareIgnoreAsciiCase( pTmp->buffer, "-pt" ); - pEscapedTmp = escape_path( pTmp ); rtl_uStringbuffer_insert( &pBuffer, &nCapacity, -- cgit