summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-22 12:29:25 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-22 12:50:14 +0000
commit4a06a42de49215167221177d47cd2eb0e2d59232 (patch)
tree51049cdbac6d6ad5bebba8e3936424ac40d26d3b /tools
parent5317e0501fe356fb38c7de408cdde1d3f3e1242e (diff)
want to match here, not check for equality
Diffstat (limited to 'tools')
-rw-r--r--tools/source/fsys/dirent.cxx50
1 files changed, 25 insertions, 25 deletions
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 647dcfcd924f..286260358faf 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -673,7 +673,7 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle )
}
rtl::OString aTmpName(rtl::OUStringToOString(rInitName, osl_getThreadTextEncoding()));
- if (aTmpName.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("file:")))
+ if (comphelper::string::matchIgnoreAsciiCaseL(aTmpName, RTL_CONSTASCII_STRINGPARAM("file:")))
{
#ifndef BOOTSTRAP
DBG_WARNING( "File URLs are not permitted but accepted" );
@@ -692,7 +692,7 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle )
}
#ifdef DBG_UTIL
- if (eStyle == FSYS_STYLE_HOST && aTmpName.indexOf( "://" ) != STRING_NOTFOUND)
+ if (eStyle == FSYS_STYLE_HOST && aTmpName.indexOf( "://" ) != -1)
{
rtl::OStringBuffer aErr(RTL_CONSTASCII_STRINGPARAM("DirEntries akzeptieren nur File URLS: "));
aErr.append(aTmpName);
@@ -727,7 +727,7 @@ DirEntry::DirEntry( const rtl::OString& rInitName, FSysPathStyle eStyle )
}
rtl::OString aTmpName( rInitName );
- if (rInitName.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("file:")))
+ if (comphelper::string::matchIgnoreAsciiCaseL(aTmpName, RTL_CONSTASCII_STRINGPARAM("file:")))
{
#ifndef BOOTSTRAP
DBG_WARNING( "File URLs are not permitted but accepted" );
@@ -1760,27 +1760,27 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
/* do nothing */;
#ifdef UNX
- // stellt der Name das User-Dir dar?
- else if ( aName == "~" )
- {
- DirEntry aHome( String( (const char *) getenv( "HOME" ), osl_getThreadTextEncoding()) );
- for ( sal_uInt16 n = aHome.Level(); n; --n )
- aStack.Push( new DirEntry( aHome[ (sal_uInt16) n-1 ] ) );
- }
+ // stellt der Name das User-Dir dar?
+ else if ( aName == "~" )
+ {
+ DirEntry aHome( String( (const char *) getenv( "HOME" ), osl_getThreadTextEncoding()) );
+ for ( sal_uInt16 n = aHome.Level(); n; --n )
+ aStack.Push( new DirEntry( aHome[ (sal_uInt16) n-1 ] ) );
+ }
#endif
-
- // stellt der Name die Parent-Directory dar?
+ // stellt der Name die Parent-Directory dar?
else if ( aName == ".." )
{
// ist nichts, ein Parent oder eine relative Root
// auf dem Stack?
- if ( ( aStack.Empty() ) ||
- ( aStack.Top()->eFlag == FSYS_FLAG_PARENT ) )
+ if ( ( aStack.Empty() ) || ( aStack.Top()->eFlag == FSYS_FLAG_PARENT ) )
+ {
// fuehrende Parents kommen auf den Stack
aStack.Push( new DirEntry(rtl::OString(), FSYS_FLAG_PARENT, eStyle) );
-
+ }
// ist es eine absolute Root
- else if ( aStack.Top()->eFlag == FSYS_FLAG_ABSROOT ) {
+ else if ( aStack.Top()->eFlag == FSYS_FLAG_ABSROOT )
+ {
// die hat keine Parent-Directory
return FSYS_ERR_NOTEXISTS;
}
@@ -1792,16 +1792,16 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
{
DirEntry *pNew = NULL;
// normalen Entries kommen auf den Stack
- pNew = new DirEntry( aName, FSYS_FLAG_NORMAL, eStyle );
- if ( !pNew->IsValid() )
- {
- aName = rPfad;
- ErrCode eErr = pNew->GetError();
- delete pNew;
- return eErr;
- }
+ pNew = new DirEntry( aName, FSYS_FLAG_NORMAL, eStyle );
+ if ( !pNew->IsValid() )
+ {
+ aName = rPfad;
+ ErrCode eErr = pNew->GetError();
+ delete pNew;
+ return eErr;
+ }
aStack.Push( pNew );
- }
+ }
}
// den Restpfad bestimmen