simplify
This commit is contained in:
@@ -161,7 +161,6 @@ char* _tcsepbrk( const char* psz, const char* chset, int escape )
|
|||||||
//========================================================
|
//========================================================
|
||||||
void _SetString( char* psz, char* end, CString* ps, bool trim = false, int escape = 0 )
|
void _SetString( char* psz, char* end, CString* ps, bool trim = false, int escape = 0 )
|
||||||
{
|
{
|
||||||
//trim
|
|
||||||
if( trim )
|
if( trim )
|
||||||
{
|
{
|
||||||
while( psz && psz < end && isspace(*psz) ) psz++;
|
while( psz && psz < end && isspace(*psz) ) psz++;
|
||||||
@@ -172,7 +171,6 @@ void _SetString( char* psz, char* end, CString* ps, bool trim = false, int escap
|
|||||||
if( escape )
|
if( escape )
|
||||||
{
|
{
|
||||||
len = _tcselen( escape, psz, end );
|
len = _tcselen( escape, psz, end );
|
||||||
// char* pss = ps->GetBufferSetLength( len );
|
|
||||||
char* szTemp = new char[len];
|
char* szTemp = new char[len];
|
||||||
unescape( szTemp, escape, psz, end );
|
unescape( szTemp, escape, psz, end );
|
||||||
*ps = szTemp;
|
*ps = szTemp;
|
||||||
@@ -180,12 +178,7 @@ void _SetString( char* psz, char* end, CString* ps, bool trim = false, int escap
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// char* pss = ps->GetBufferSetLength(len + 1 );
|
ps->assign( psz, len );
|
||||||
char* szTemp = new char[len+1];
|
|
||||||
memcpy( szTemp, psz, len );
|
|
||||||
szTemp[len] = '\0';
|
|
||||||
*ps = szTemp;
|
|
||||||
delete [] szTemp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user