mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Use internal implementation for wcsncasecmp
darcs-hash:20051003152639-ac50b-581206ef8148f4d24875862f6cc09909b369fac0.gz
This commit is contained in:
parent
227e4a1999
commit
1026c17e7e
20
common.c
20
common.c
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user