1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:25:06 +00:00

Add sys$gethostname and /bin/hostname

This commit is contained in:
Andreas Kling 2018-10-26 09:54:29 +02:00
parent 3faaa3e04a
commit 53abfa7ea1
16 changed files with 77 additions and 40 deletions

View file

@ -22,6 +22,18 @@ String String::empty()
return StringImpl::theEmptyStringImpl();
}
String String::isolatedCopy() const
{
if (!m_impl)
return { };
if (!m_impl->length())
return empty();
char* buffer;
auto impl = StringImpl::createUninitialized(length(), buffer);
memcpy(buffer, m_impl->characters(), m_impl->length());
return String(move(*impl));
}
String String::substring(size_t start, size_t length) const
{
ASSERT(m_impl);