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

AK: Make FileSystemPath::extension() return what's after the last '.'

This commit is contained in:
Andreas Kling 2020-05-14 20:41:17 +02:00
parent 953669374c
commit f4c60740bd

View file

@ -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) {