summaryrefslogtreecommitdiff
path: root/desktop
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-08 14:35:17 +0000
commit3ee8f5cd26b27dae44ecb494b975855e1fe524ba (patch)
treea73b7cda6cb96efb1c76f82b1533abb3e39fe2c2 /desktop
parent2bebe311aa88fd782bf0fb502642da0fd4311053 (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.
Diffstat (limited to 'desktop')
-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 cc8d9da53a94..1f5396ae918e 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