aboutsummaryrefslogtreecommitdiff
path: root/core.c
diff options
context:
space:
mode:
authorneonloop2021-08-12 15:30:51 +0000
committerneonloop2021-08-12 15:30:51 +0000
commit1aff43f93d09b207d97cdf18ccf8d28aedc49158 (patch)
tree3805c847e4b2ca04727a3e15a3c9ae9af99c3191 /core.c
parent4f6bbfe3a4e16b3d322f9cd86a5f9ea1b8535d51 (diff)
downloadpicoarch-1aff43f93d09b207d97cdf18ccf8d28aedc49158.tar.gz
picoarch-1aff43f93d09b207d97cdf18ccf8d28aedc49158.tar.bz2
picoarch-1aff43f93d09b207d97cdf18ccf8d28aedc49158.zip
Places bios/etc in cwd/system rather than cwd
Diffstat (limited to 'core.c')
-rw-r--r--core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/core.c b/core.c
index bb37aa8..37a2368 100644
--- a/core.c
+++ b/core.c
@@ -212,6 +212,7 @@ error:
static void set_directories(void) {
const char *home = getenv("HOME");
+ char cwd[MAX_PATH];
char *dst = save_dir;
int len = MAX_PATH;
@@ -225,7 +226,10 @@ static void set_directories(void) {
#ifdef MINUI
strncpy(system_dir, save_dir, MAX_PATH-1);
#else
- if (!getcwd(system_dir, MAX_PATH)) {
+ if (getcwd(cwd, MAX_PATH)) {
+ snprintf(system_dir, MAX_PATH, "%s/system", cwd);
+ mkdir(system_dir, 0755);
+ } else {
PA_FATAL("Can't find system directory");
}
#endif