mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Userland: Convert command line arguments to String/StringView
StringView was used where possible. Some utilities still use libc functions which expect null-terminated strings, so String objects were used there instead.
This commit is contained in:
@@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
bool gzip = false;
|
||||
bool no_auto_compress = false;
|
||||
StringView archive_file;
|
||||
char const* directory = nullptr;
|
||||
StringView directory;
|
||||
Vector<String> paths;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
@@ -64,7 +64,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
if (!archive_file.is_empty())
|
||||
file = TRY(Core::File::open(archive_file, Core::OpenMode::ReadOnly));
|
||||
|
||||
if (directory)
|
||||
if (!directory.is_empty())
|
||||
TRY(Core::System::chdir(directory));
|
||||
|
||||
Core::InputFileStream file_stream(file);
|
||||
@@ -213,7 +213,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
if (!archive_file.is_empty())
|
||||
file = TRY(Core::File::open(archive_file, Core::OpenMode::WriteOnly));
|
||||
|
||||
if (directory)
|
||||
if (!directory.is_empty())
|
||||
TRY(Core::System::chdir(directory));
|
||||
|
||||
Core::OutputFileStream file_stream(file);
|
||||
|
||||
Reference in New Issue
Block a user