userspace/libc: implement strcoll()

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-02-14 02:18:40 +02:00
parent 22d01c7a51
commit afa87ec5f3
2 changed files with 12 additions and 2 deletions

View File

@ -72,7 +72,17 @@ export int strcmp(const char *s1, const char *s2)
return *(unsigned char *)s1 - *(unsigned char *)s2;
}
export int strcoll(const char *, const char *);
export int strcoll(const char *s1, const char *s2)
{
while (*s1 && (*s1 == *s2))
{
s1++;
s2++;
}
return *(unsigned char *)s1 - *(unsigned char *)s2;
}
export int strcoll_l(const char *, const char *, locale_t);
export char *strcpy(char *restrict, const char *restrict);