mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibCore: Convert CFile to ObjectPtr
This commit is contained in:
parent
31b38ed88f
commit
8d550c174e
30 changed files with 135 additions and 134 deletions
|
@ -35,11 +35,11 @@ static String parse_dns_name(const u8*, int& offset, int max_offset);
|
|||
static void load_etc_hosts()
|
||||
{
|
||||
dbgprintf("LookupServer: Loading hosts from /etc/hosts\n");
|
||||
CFile file("/etc/hosts");
|
||||
if (!file.open(CIODevice::ReadOnly))
|
||||
auto file = CFile::construct("/etc/hosts");
|
||||
if (!file->open(CIODevice::ReadOnly))
|
||||
return;
|
||||
while (!file.eof()) {
|
||||
auto line = file.read_line(1024);
|
||||
while (!file->eof()) {
|
||||
auto line = file->read_line(1024);
|
||||
if (line.is_empty())
|
||||
break;
|
||||
auto str_line = String((const char*)line.pointer(), line.size() - 1, Chomp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue