mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
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.
This commit is contained in:
committed by
Andreas Kling
parent
9b8f35259c
commit
fc6d051dfd
@@ -56,7 +56,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
g_test_argc = argc;
|
||||
g_test_argv = argv;
|
||||
auto program_name = LexicalPath { argv[0] }.basename();
|
||||
auto program_name = LexicalPath::basename(argv[0]);
|
||||
g_program_name = program_name;
|
||||
|
||||
struct sigaction act;
|
||||
|
||||
Reference in New Issue
Block a user