summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2011-02-08 14:35:17 +0000
committerNoel Power <noel.power@novell.com>2011-02-11 14:44:34 +0000
commitaa19c0ba41fbfdf9d3d031c7e0ba16e99a43eff9 (patch)
tree228c6af5c676dc0b3aa4b6e19fa77915a7b2832f
parentd18c9a17f33c100fa38e65209f4353cad63ba0af (diff)
companion ( or even part 2 ) of a fix for fdo#30879
tweak oosplash arg handling to not clobber some special url protocols, '.uno', '.slot' etc. Signed-off-by: Michael Meeks <michael.meeks@novell.com>
-rw-r--r--desktop/unx/source/start.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index dc28614fc6..38183f8a92 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -359,14 +359,30 @@ send_args( int fd, rtl_uString *pCwdPath )
// this is not a param, we have to prepend filenames with file://
// FIXME: improve the check
- if ( ( pTmp->buffer[0] != (sal_Unicode)'-' ) &&
- ( rtl_ustr_indexOfAscii_WithLength( pTmp->buffer, pTmp->length, "slot:", 5 /* length */ ) ) )
+ 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
- if ( nFirstColon < 1 || ( nFirstSlash != nFirstColon + 1 ) )
+ // 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 index = 0;
+ int len = SAL_N_ELEMENTS(schemes);
+ for ( ; index < len; ++index )
+ {
+ if ( rtl_ustr_indexOfAscii_WithLength( pTmp->buffer
+ , pTmp->length , schemes[ index ], strlen(schemes[ index ] )) == 1 )
+ {
+ 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