mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +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:
parent
13e6d9d71a
commit
95c32fdf19
Notes:
sideshowbarker
2024-07-18 02:15:25 +09:00
Author: https://github.com/BertalanD
Commit: 95c32fdf19
Pull-request: https://github.com/SerenityOS/serenity/pull/9378
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/itamar8910
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/nico
Reviewed-by: https://github.com/timschumi
2 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue