1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

Canonicalize the path used by sh.

With a bunch of LibC work to support the feature. LibC now initializes
AK::StringImpl by default. It's now fine to use AK in LibC/Userland! :^)
This commit is contained in:
Andreas Kling 2018-10-28 09:36:21 +01:00
parent 88ad59bfb1
commit e904f193c1
15 changed files with 170 additions and 24 deletions

View file

@ -21,6 +21,17 @@ int strcmp(const char* s1, const char* s2)
return *(const unsigned char*)s1 < *(const unsigned char*)s2 ? -1 : 1;
}
int memcmp(const void* v1, const void* v2, size_t n)
{
auto* s1 = (const byte*)v1;
auto* s2 = (const byte*)v2;
while (n-- > 0) {
if (*s1++ != *s2++)
return s1[-1] < s2[-1] ? -1 : 1;
}
return 0;
}
void memcpy(void* dest, const void* src, size_t n)
{
auto* bdest = (unsigned char*)dest;