1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

Everywhere: Move shared library checks into a common function

While we're at it, unify the various different conditions that are
scattered accross the codebase.
This commit is contained in:
Tim Schumacher 2021-11-03 12:05:23 +01:00 committed by Andreas Kling
parent 31c634be5a
commit 80cb44afae
7 changed files with 25 additions and 6 deletions

View file

@ -147,6 +147,16 @@ bool File::is_link(String const& filename)
return S_ISLNK(st.st_mode);
}
bool File::looks_like_shared_library() const
{
return File::looks_like_shared_library(m_filename);
}
bool File::looks_like_shared_library(const String& filename)
{
return filename.ends_with(".so"sv) || filename.contains(".so."sv);
}
bool File::exists(String const& filename)
{
struct stat st;