mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
strings: Don't bail immediately on error
Previously, strings would exit immediately if there was an error changing file ownership. We now print an error to stderr and continue when an error occurs.
This commit is contained in:
parent
c723101728
commit
ba34931620
1 changed files with 9 additions and 3 deletions
|
@ -139,8 +139,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (paths.is_empty())
|
||||
paths.append("-"sv);
|
||||
|
||||
for (auto const& path : paths)
|
||||
TRY(process_strings_in_file(path, show_paths, string_offset_format, minimum_string_length));
|
||||
bool has_errors = false;
|
||||
for (auto const& path : paths) {
|
||||
auto maybe_error = process_strings_in_file(path, show_paths, string_offset_format, minimum_string_length);
|
||||
if (maybe_error.is_error()) {
|
||||
warnln("strings: '{}'. {}", path, strerror(maybe_error.error().code()));
|
||||
has_errors = true;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return has_errors ? 1 : 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue