Everywhere: Convert from_string_view -> from_string_literal where static

This commit is contained in:
Asutosh Variar 2024-09-05 15:06:15 +04:00 committed by Sam Atkins
commit 229b64a4b7
Notes: github-actions[bot] 2024-09-11 09:59:55 +00:00
26 changed files with 80 additions and 80 deletions

View file

@ -1825,16 +1825,16 @@ ErrorOr<ByteString> current_executable_path()
for (int32 cookie { 0 }; get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK && info.type != B_APP_IMAGE;)
;
if (info.type != B_APP_IMAGE)
return Error::from_string_view("current_executable_path() failed"sv);
return Error::from_string_literal("current_executable_path() failed");
if (sizeof(info.name) > sizeof(path))
return Error::from_errno(ENAMETOOLONG);
strlcpy(path, info.name, sizeof(path) - 1);
#elif defined(AK_OS_EMSCRIPTEN)
return Error::from_string_view("current_executable_path() unknown on this platform"sv);
return Error::from_string_literal("current_executable_path() unknown on this platform");
#else
# warning "Not sure how to get current_executable_path on this platform!"
// GetModuleFileName on Windows, unsure about OpenBSD.
return Error::from_string_view("current_executable_path unknown"sv);
return Error::from_string_literal("current_executable_path unknown");
#endif
path[sizeof(path) - 1] = '\0';
return ByteString { path, strlen(path) };