diff --git a/libs/libc/include/string.h b/libs/libc/include/string.h index 7dd597c5..88e133b2 100644 --- a/libs/libc/include/string.h +++ b/libs/libc/include/string.h @@ -71,6 +71,9 @@ extern "C" /* Compares at most max bytes of the strings a and b. */ int strncmp(const char* a, const char* b, size_t max); + /* Compares a and b based on the current locale. */ + int strcoll(const char* a, const char* b); + /* Searches for the needle string in the haystack string. */ char* strstr(const char* haystack, const char* needle); diff --git a/libs/libc/src/string.cpp b/libs/libc/src/string.cpp index f07ff7b5..7ba70640 100644 --- a/libs/libc/src/string.cpp +++ b/libs/libc/src/string.cpp @@ -131,6 +131,11 @@ extern "C" return *(const unsigned char*)a - *(const unsigned char*)b; } + int strcoll(const char* a, const char* b) + { + return strcmp(a, b); + } + size_t strcspn(const char* str, const char* reject) { const char* s = str;