1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:37:35 +00:00

LibFileSystem+Userland: Return ByteString from real_path()

This commit is contained in:
Sam Atkins 2024-01-15 16:23:24 +00:00 committed by Sam Atkins
parent cdf17efb9a
commit 56c5ffe398
25 changed files with 44 additions and 40 deletions

View file

@ -413,11 +413,11 @@ bool DirectoryView::open(ByteString const& path)
warnln("Failed to open '{}': {}", real_path, result.error());
}
if (model().root_path() == real_path.to_byte_string()) {
if (model().root_path() == real_path) {
refresh();
} else {
set_active_widget(&current_view());
model().set_root_path(real_path.to_byte_string());
model().set_root_path(real_path);
}
return true;
}

View file

@ -109,7 +109,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
LexicalPath path(initial_location);
if (!initial_location.is_empty()) {
if (auto error_or_path = FileSystem::real_path(initial_location); !ignore_path_resolution && !error_or_path.is_error())
initial_location = error_or_path.release_value().to_byte_string();
initial_location = error_or_path.release_value();
if (!FileSystem::is_directory(initial_location)) {
// We want to extract zips to a temporary directory when FileManager is launched with a .zip file as its first argument