summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Kosek <krkk@krkk.ct8.pl>2021-08-02 16:19:47 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-03 09:12:33 +0200
commit4988540cb16699c715a737e473cb68e64f4f40ea (patch)
tree1f10e14bc97116ca24676b823ea1b306b1f5c36b
parent35cc5b9873a4c7b87308afe259f8fcca189426d1 (diff)
downloadserenity-4988540cb16699c715a737e473cb68e64f4f40ea.zip
FileManager: Use the current directory as one of the initial locations
This change makes `cd /bin; FileManager` open the app in /bin.
-rw-r--r--Userland/Applications/FileManager/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp
index c2f17ea74a..e0384a2333 100644
--- a/Userland/Applications/FileManager/main.cpp
+++ b/Userland/Applications/FileManager/main.cpp
@@ -98,8 +98,9 @@ int main(int argc, char** argv)
// our initial location is defined as, in order of precedence:
// 1. the command-line path argument (e.g. FileManager /bin)
- // 2. the user's home directory
- // 3. the root directory
+ // 2. the current directory
+ // 3. the user's home directory
+ // 4. the root directory
if (!initial_location.is_empty()) {
if (!ignore_path_resolution)
@@ -110,6 +111,9 @@ int main(int argc, char** argv)
}
if (initial_location.is_empty())
+ initial_location = Core::File::current_working_directory();
+
+ if (initial_location.is_empty())
initial_location = Core::StandardPaths::home_directory();
if (initial_location.is_empty())