aboutsummaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/menu.c b/menu.c
index 66ee8ef..a76ea44 100644
--- a/menu.c
+++ b/menu.c
@@ -250,17 +250,25 @@ const char *select_content(void) {
if (content && strlen(content->path)) {
strncpy(content_path, content->path, sizeof(content_path) - 1);
- } else if (getenv("CONTENT_DIR")) {
- strncpy(content_path, getenv("CONTENT_DIR"), sizeof(content_path) - 1);
-#ifdef CONTENT_DIR
} else {
- strncpy(content_path, CONTENT_DIR, sizeof(content_path) - 1);
+ core_load_last_opened(content_path, sizeof(content_path));
+ }
+
+ if (!content_path[0]) {
+ if (getenv("CONTENT_DIR")) {
+ strncpy(content_path, getenv("CONTENT_DIR"), sizeof(content_path) - 1);
+#ifdef CONTENT_DIR
+ } else {
+ strncpy(content_path, CONTENT_DIR, sizeof(content_path) - 1);
#else
- } else if (getenv("HOME")) {
- strncpy(content_path, getenv("HOME"), sizeof(content_path) - 1);
+ } else if (getenv("HOME")) {
+ strncpy(content_path, getenv("HOME"), sizeof(content_path) - 1);
#endif
+ }
}
+ content_path[sizeof(content_path) - 1] = '\0';
+
if (extensions) {
for (size = 0; extensions[size]; size++)
;