1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:27:34 +00:00

LibC: Primitively implement wcsxfrm

The `wcsxfrm` function copies a wide character string into a buffer,
such that comparing the new string against any similarly pre-processed
string with `wcscmp` produces the same result as if the original strings
were compared with `wcscoll`.

Our current `wcscoll` implementation is simply an alias for `wcscmp`, so
`wcsxfrm` needs to perform no actions other than copying the string.
This commit is contained in:
Daniel Bertalan 2021-10-16 10:40:27 +02:00 committed by Linus Groh
parent 13e6d9d71a
commit 95c32fdf19
2 changed files with 7 additions and 0 deletions

View file

@ -331,6 +331,12 @@ int wcscoll(const wchar_t* ws1, const wchar_t* ws2)
return wcscmp(ws1, ws2);
}
size_t wcsxfrm(wchar_t* dest, const wchar_t* src, size_t n)
{
// TODO: This needs to be changed when wcscoll is not just doing wcscmp
return wcslcpy(dest, src, n);
}
int wctob(wint_t c)
{
if (c > 0x7f)