diff options
author | Jan-Marek Glogowski <jan-marek.glogowski@extern.cib.de> | 2019-11-26 22:05:10 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-11-27 21:55:25 +0100 |
commit | 895cd72158fc8a455f705764ae4ae000b933eba4 (patch) | |
tree | 8ddb2c5036427947ff05ffc97df415836cbf681c /sal/osl/w32 | |
parent | e021901b6c4f60735512c8d36b625be4f8edfd77 (diff) |
WIN accept single-backslash file URIs
From all I could find, a single (back-)slash file URI is fine as
a local file path.
Change-Id: I75e95c809894cdef88f708d0477cb98eb114a107
Reviewed-on: https://gerrit.libreoffice.org/83837
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'sal/osl/w32')
-rw-r--r-- | sal/osl/w32/file_url.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index e44a17a4d472..a5aba24248c4 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -676,7 +676,7 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p SAL_WARN_IF( strUTF8->length != strURL->length && - 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( strURL->buffer, strURL->length, "file:\\\\", 7 ) + 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( strURL->buffer, strURL->length, "file:\\", 6 ) , "sal.osl" ,"osl_getSystemPathFromFileURL: \"" << OUString(strURL) << "\" is not encoded !!!"); @@ -695,8 +695,8 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p const sal_Unicode *pDecodedURL = rtl_uString_getStr( strDecodedURL ); nDecodedLen = rtl_uString_getLength( strDecodedURL ); - /* Must start with "file://" */ - if ( 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL, nDecodedLen, "file:\\\\", 7 ) ) + /* Must start with "file:/" */ + if ( 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL, nDecodedLen, "file:\\", 6 ) ) { sal_uInt32 nSkip; @@ -707,8 +707,10 @@ oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **p 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL, nDecodedLen, "file:\\\\127.0.0.1\\", 17 ) ) nSkip = 17; - else + else if ( 0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( pDecodedURL, nDecodedLen, "file:\\\\", 7 ) ) nSkip = 5; + else + nSkip = 6; /* Indicates local root */ if ( nDecodedLen == nSkip ) |