diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-06-29 16:46:16 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-30 11:13:54 +0200 |
commit | fc6d051dfdddc13835548537d025e760ba186b5b (patch) | |
tree | 12a5602dd4efc20f023fea95d390f3e241f6f9cf /Userland/DevTools/HackStudio/ProjectTemplate.cpp | |
parent | 9b8f35259c375f6911b76c38ec37e6d422b26bbe (diff) | |
download | serenity-fc6d051dfdddc13835548537d025e760ba186b5b.zip |
AK+Everywhere: Add and use static APIs for LexicalPath
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.
To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
Diffstat (limited to 'Userland/DevTools/HackStudio/ProjectTemplate.cpp')
-rw-r--r-- | Userland/DevTools/HackStudio/ProjectTemplate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/ProjectTemplate.cpp b/Userland/DevTools/HackStudio/ProjectTemplate.cpp index 77c186af49..12ca28d24f 100644 --- a/Userland/DevTools/HackStudio/ProjectTemplate.cpp +++ b/Userland/DevTools/HackStudio/ProjectTemplate.cpp @@ -38,7 +38,7 @@ RefPtr<ProjectTemplate> ProjectTemplate::load_from_manifest(const String& manife || !config->has_key("HackStudioTemplate", "IconName32x")) return {}; - auto id = LexicalPath(manifest_path).title(); + auto id = LexicalPath::title(manifest_path); auto name = config->read_entry("HackStudioTemplate", "Name"); auto description = config->read_entry("HackStudioTemplate", "Description"); int priority = config->read_num_entry("HackStudioTemplate", "Priority", 0); |