From ec90cdc0a54c80ded9eac95c4c0fa817d3238165 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Fri, 1 Apr 2016 09:36:29 -0700 Subject: [PATCH] Duplicate separator fix, AROS seems to need this. --- src/fco/fcodatasourceiterimpl.cpp | 5 +--- src/fco/fconame.cpp | 47 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/fco/fcodatasourceiterimpl.cpp b/src/fco/fcodatasourceiterimpl.cpp index a9846db..7c8b9ec 100644 --- a/src/fco/fcodatasourceiterimpl.cpp +++ b/src/fco/fcodatasourceiterimpl.cpp @@ -200,10 +200,7 @@ void cFCODataSourceIterImpl::Next() iFCO* cFCODataSourceIterImpl::CreateFCO() //throw (eError) { ASSERT( ! Done() ); - - if( ! InitializeTypeInfo( *mCurPos ) ) - return 0; - + InitializeTypeInfo( *mCurPos ); (*mCurPos)->AddRef(); return *mCurPos; } diff --git a/src/fco/fconame.cpp b/src/fco/fconame.cpp index 312c94b..a11d72a 100644 --- a/src/fco/fconame.cpp +++ b/src/fco/fconame.cpp @@ -265,31 +265,36 @@ void cFCOName::ParseString(const TCHAR* str) void cFCOName::ParseString( const TCHAR* pszin ) { - ASSERT( mpPathName != 0); - - mpPathName->ClearList(); - - TSTRING ats = const_cast(pszin + 0); - TSTRING::const_iterator at = ats.begin(); - TSTRING::const_iterator end = at; - while ( *end ) ++end; // NOTE: Find end + ASSERT(mpPathName != 0); + ASSERT(pszin != 0); + + mpPathName->ClearList(); + + const TCHAR* at = (pszin + 0); + const TCHAR* begin = at; + const TCHAR* end = at; + int components = 0; - TSTRING::const_iterator beg = at; - while ( at < end ) - { - while ( !(*at == mDelimiter) && at < end ) - at = *at ? at + 1 : at; + while (*end) + ++end; - if ( at == beg && (*at ? at + 1 : at) >= end && at != ats.begin() ) - break; + while (at < end) + { + while (!(*at == mDelimiter) && (at < end)) + at++; - cFCONameTblNode* pNode = - cFCOName_i::msNameTbl.CreateNode( TSTRING( beg, at ) ); + TSTRING name(begin, at); + if (name.length() > 0 || components == 0) + { + cFCONameTblNode* pNode = + cFCOName_i::msNameTbl.CreateNode(name); + + mpPathName->mNames.push_back(pNode); + } - mpPathName->mNames.push_back( pNode ); - - beg = ( at = (*at ? at + 1 : at) ); - } + components++; + begin = (at = tss::strinc(at)); + } } #endif//RADS_NTMBS_VER