From 7ceeb745354e246ec91cbdcd6f17c8291c09aec0 Mon Sep 17 00:00:00 2001 From: DexesTTP Date: Tue, 5 Jul 2022 22:33:15 +0200 Subject: AK: Use an enum instead of a bool for String::replace(all_occurences) This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect. --- Userland/Libraries/LibC/netdb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Userland/Libraries/LibC/netdb.cpp') diff --git a/Userland/Libraries/LibC/netdb.cpp b/Userland/Libraries/LibC/netdb.cpp index 69e9e3e992..ef93dfd08d 100644 --- a/Userland/Libraries/LibC/netdb.cpp +++ b/Userland/Libraries/LibC/netdb.cpp @@ -451,7 +451,7 @@ void endservent() static bool fill_getserv_buffers(char const* line, ssize_t read) { // Splitting the line by tab delimiter and filling the servent buffers name, port, and protocol members. - auto split_line = StringView(line, read).replace(" ", "\t", true).split('\t'); + auto split_line = StringView(line, read).replace(" ", "\t", ReplaceMode::All).split('\t'); // This indicates an incorrect file format. // Services file entries should always at least contain @@ -474,7 +474,7 @@ static bool fill_getserv_buffers(char const* line, ssize_t read) __getserv_port_buffer = number.value(); // Remove any annoying whitespace at the end of the protocol. - __getserv_protocol_buffer = port_protocol_split[1].replace(" ", "", true).replace("\t", "", true).replace("\n", "", true); + __getserv_protocol_buffer = port_protocol_split[1].replace(" ", "", ReplaceMode::All).replace("\t", "", ReplaceMode::All).replace("\n", "", ReplaceMode::All); __getserv_alias_list_buffer.clear(); // If there are aliases for the service, we will fill the alias list buffer. @@ -630,7 +630,7 @@ void endprotoent() static bool fill_getproto_buffers(char const* line, ssize_t read) { String string_line = String(line, read); - auto split_line = string_line.replace(" ", "\t", true).split('\t'); + auto split_line = string_line.replace(" ", "\t", ReplaceMode::All).split('\t'); // This indicates an incorrect file format. Protocols file entries should // always have at least a name and a protocol. -- cgit v1.2.3