mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-19 14:14:41 +00:00
Add sys$gethostname and /bin/hostname
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user