mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibCore+Everywhere: Remove ArgsParser::add*(char const*&)
This is not guaranteed to always work correctly as ArgsParser deals in StringViews and might have a non-properly-null-terminated string as a value. As a bonus, using StringView (and DeprecatedString where necessary) leads to nicer looking code too :^)
This commit is contained in:
committed by
Andreas Kling
parent
60908adcbe
commit
500044906d
@@ -167,7 +167,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
StringView file_to_read_from = {};
|
||||
Vector<StringView> script_args;
|
||||
bool skip_rc_files = false;
|
||||
char const* format = nullptr;
|
||||
StringView format;
|
||||
bool should_format_live = false;
|
||||
bool keep_open = false;
|
||||
bool posix_mode = false;
|
||||
@@ -185,7 +185,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
parser.set_stop_on_first_non_option(true);
|
||||
parser.parse(arguments);
|
||||
|
||||
if (format) {
|
||||
if (!format.is_empty()) {
|
||||
auto file = TRY(Core::DeprecatedFile::open(format, Core::OpenMode::ReadOnly));
|
||||
|
||||
initialize(posix_mode);
|
||||
|
||||
Reference in New Issue
Block a user