From 09b23dd35f40a2b86ec421ae0d87b31b18b70b16 Mon Sep 17 00:00:00 2001
From: Hennes Rohling <hro@openoffice.org>
Date: Wed, 20 Dec 2000 10:06:32 +0000
Subject: #82359# Mountpoint must matsch with path including trailing slash

---
 ucb/source/ucp/file/shell.cxx | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

(limited to 'ucb/source')

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 );
-- 
cgit