mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
9b8f35259c
commit
fc6d051dfd
Notes:
sideshowbarker
2024-07-18 11:13:39 +09:00
Author: https://github.com/MaxWipfli
Commit: fc6d051dfd
Pull-request: https://github.com/SerenityOS/serenity/pull/8320
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
43 changed files with 80 additions and 56 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue