diff options
author | Hennes Rohling <hro@openoffice.org> | 2000-12-20 10:06:32 +0000 |
---|---|---|
committer | Hennes Rohling <hro@openoffice.org> | 2000-12-20 10:06:32 +0000 |
commit | 09b23dd35f40a2b86ec421ae0d87b31b18b70b16 (patch) | |
tree | c8c47cfb32b11cdf46cb20b41d1bd3a141efc45c /ucb/source/ucp | |
parent | 5d9832de985ae577158ca00acc9c9ba31f279f53 (diff) |
#82359# Mountpoint must matsch with path including trailing slash
Diffstat (limited to 'ucb/source/ucp')
-rw-r--r-- | ucb/source/ucp/file/shell.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index cf337a63e7d1..159231a3ee23 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shell.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: hr $ $Date: 2000-12-12 18:09:46 $ + * last change: $Author: hro $ $Date: 2000-12-20 11:06:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3452,7 +3452,7 @@ sal_Bool SAL_CALL shell::checkMountPoint( const rtl::OUString& aUnqPath, rtl::OUString aDir = m_vecMountPoint[j].m_aDirectory; sal_Int32 nL = aAlias.getLength(); - if( aUnqPath.compareTo( aAlias,nL ) == 0 ) + if( aUnqPath.compareTo( aAlias,nL ) == 0 && ( aUnqPath.getLength() == nL || aUnqPath[nL] == '/' ) ) { aRedirectedPath = aDir; aRedirectedPath += aUnqPath.copy( nL ); @@ -3496,14 +3496,21 @@ sal_Bool SAL_CALL shell::uncheckMountPoint( const rtl::OUString& aUnqPath, if ( !aRealUnqPath.pData->length ) error = osl_getRealPath( aUnqPath.pData, &aRealUnqPath.pData ); - if ( osl_File_E_None == error && aRealUnqPath.compareTo( m_vecMountPoint[j].m_aDirectory,nL ) == 0 ) + rtl::OUString dir = m_vecMountPoint[j].m_aDirectory; + + if ( osl_File_E_None == error && aRealUnqPath.compareTo( dir,nL ) == 0 && + ( aRealUnqPath.getLength() == nL || aRealUnqPath[nL] == '/' ) ) { aRedirectedPath = m_vecMountPoint[j].m_aMountPoint; aRedirectedPath += aUnqPath.copy( nL ); return true; } #else - if( aUnqPath.compareTo( m_vecMountPoint[j].m_aDirectory,nL ) == 0 ) + rtl::OUString dir = m_vecMountPoint[j].m_aDirectory; + + if( aUnqPath.compareTo( dir,nL ) == 0 && + ( aUnqPath.getLength() == nL || aUnqPath[nL] == '/' ) + ) { aRedirectedPath = m_vecMountPoint[j].m_aMountPoint; aRedirectedPath += aUnqPath.copy( nL ); |