Use internal implementation for wcsncasecmp

darcs-hash:20051003152639-ac50b-581206ef8148f4d24875862f6cc09909b369fac0.gz
This commit is contained in:
axel
2005-10-04 01:26:39 +10:00
parent 227e4a1999
commit 1026c17e7e
2 changed files with 21 additions and 1 deletions

View File

@@ -602,6 +602,26 @@ int wcscasecmp( const wchar_t *a, const wchar_t *b )
return wcscasecmp( a+1,b+1);
}
int wcsncasecmp( const wchar_t *a, const wchar_t *b, int count )
{
if( count == 0 )
return 0;
if( *a == 0 )
{
return (*b==0)?0:-1;
}
else if( *b == 0 )
{
return 1;
}
int diff = towlower(*a)-towlower(*b);
if( diff != 0 )
return diff;
else
return wcsncasecmp( a+1,b+1, count-1);
}
int wcsvarname( wchar_t *str )
{
while( *str )