mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:52:59 +00:00
Fixed _wcsnicmp()
svn path=/trunk/; revision=981
This commit is contained in:
parent
326a3cd58b
commit
5f71c29e2c
3 changed files with 60 additions and 61 deletions
|
@ -2,13 +2,13 @@
|
|||
|
||||
int _wcsnicmp (const wchar_t *cs, const wchar_t *ct, size_t count)
|
||||
{
|
||||
wchar_t *save = (wchar_t *)cs;
|
||||
while (towlower(*cs) == towlower(*ct) && (int)(cs - save) < count)
|
||||
{
|
||||
if (*cs == 0)
|
||||
if (count == 0)
|
||||
return 0;
|
||||
do {
|
||||
if (towupper(*cs) != towupper(*ct++))
|
||||
return towupper(*cs) - towupper(*--ct);
|
||||
if (*cs++ == 0)
|
||||
break;
|
||||
} while (--count != 0);
|
||||
return 0;
|
||||
cs++;
|
||||
ct++;
|
||||
}
|
||||
return towlower(*cs) - towlower(*ct);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: wstring.c,v 1.7 2000/02/05 23:45:46 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: lib/ntdll/string/wstring.c
|
||||
|
@ -14,9 +15,6 @@
|
|||
#include <ddk/ntddk.h>
|
||||
#include <wchar.h>
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
// static wchar_t * ___wcstok = NULL;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
|
@ -44,17 +42,18 @@ wchar_t* _wcslwr(wchar_t *x)
|
|||
return x;
|
||||
}
|
||||
|
||||
|
||||
int _wcsnicmp (const wchar_t * cs, const wchar_t * ct, size_t count)
|
||||
{
|
||||
wchar_t *save = (wchar_t *)cs;
|
||||
while (towlower(*cs) == towlower(*ct) && (int)(cs - save) < count)
|
||||
{
|
||||
if (*cs == 0)
|
||||
if (count == 0)
|
||||
return 0;
|
||||
do {
|
||||
if (towupper(*cs) != towupper(*ct++))
|
||||
return towupper(*cs) - towupper(*--ct);
|
||||
if (*cs++ == 0)
|
||||
break;
|
||||
} while (--count != 0);
|
||||
return 0;
|
||||
cs++;
|
||||
ct++;
|
||||
}
|
||||
return towlower(*cs) - towlower(*ct);
|
||||
}
|
||||
|
||||
|
||||
|
@ -155,8 +154,7 @@ size_t wcslen(const wchar_t *s)
|
|||
return len;
|
||||
}
|
||||
|
||||
wchar_t *
|
||||
wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
|
||||
wchar_t *wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
@ -286,3 +284,5 @@ wchar_t *wcsstr(const wchar_t *s,const wchar_t *b)
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -46,15 +46,15 @@ wchar_t * _wcslwr (wchar_t *x)
|
|||
|
||||
int _wcsnicmp (const wchar_t * cs,const wchar_t * ct,size_t count)
|
||||
{
|
||||
wchar_t *save = (wchar_t *)cs;
|
||||
while (towlower(*cs) == towlower(*ct) && (int)(cs - save) < count)
|
||||
{
|
||||
if (*cs == 0)
|
||||
if (count == 0)
|
||||
return 0;
|
||||
do {
|
||||
if (towupper(*cs) != towupper(*ct++))
|
||||
return towupper(*cs) - towupper(*--ct);
|
||||
if (*cs++ == 0)
|
||||
break;
|
||||
} while (--count != 0);
|
||||
return 0;
|
||||
cs++;
|
||||
ct++;
|
||||
}
|
||||
return towlower(*cs) - towlower(*ct);
|
||||
}
|
||||
|
||||
|
||||
|
@ -235,8 +235,7 @@ int wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count)
|
|||
}
|
||||
|
||||
|
||||
wchar_t *
|
||||
wcsncpy(wchar_t *dest, const wchar_t *src, size_t count)
|
||||
wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t count)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue