summaryrefslogtreecommitdiff
path: root/app/mac
diff options
context:
space:
mode:
Diffstat (limited to 'app/mac')
-rw-r--r--app/mac/impl/file-browser-posix.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/mac/impl/file-browser-posix.cc b/app/mac/impl/file-browser-posix.cc
index 4c717fd..8cde6b7 100644
--- a/app/mac/impl/file-browser-posix.cc
+++ b/app/mac/impl/file-browser-posix.cc
@@ -3,11 +3,21 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
+#include <stdlib.h>
namespace nes::app::mac
{
file_browser_posix::file_browser_posix()
{
+ auto const initial_path = getenv("HOME");
+ if (initial_path)
+ {
+ for (auto const component : path_view{ initial_path })
+ {
+ if (path_.push(component) != status::success) { break; }
+ }
+ }
+
reopen_directory(path_.get_path());
}