summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-14 20:41:17 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-14 20:41:17 +0200
commitf4c60740bdbb107a8b6362ec5577333983c9af1b (patch)
treec859cbc7f31c885be95c5895c437e35ce3b8f5e2
parent953669374c1d5c723db9e1b959044760fa1b9842 (diff)
downloadserenity-f4c60740bdbb107a8b6362ec5577333983c9af1b.zip
AK: Make FileSystemPath::extension() return what's after the last '.'
-rw-r--r--AK/FileSystemPath.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/FileSystemPath.cpp b/AK/FileSystemPath.cpp
index fe93ccee66..ef0e824d7b 100644
--- a/AK/FileSystemPath.cpp
+++ b/AK/FileSystemPath.cpp
@@ -88,7 +88,7 @@ void FileSystemPath::canonicalize()
auto name_parts = m_basename.split('.');
m_title = name_parts.is_empty() ? String() : name_parts[0];
if (name_parts.size() > 1)
- m_extension = name_parts[1];
+ m_extension = name_parts.last();
StringBuilder builder(approximate_canonical_length);
for (size_t i = 0; i < canonical_parts.size(); ++i) {