summaryrefslogtreecommitdiff
path: root/firmware/common
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/rbpaths.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/common/rbpaths.c b/firmware/common/rbpaths.c
index 69bc1387ef..b63586c9f4 100644
--- a/firmware/common/rbpaths.c
+++ b/firmware/common/rbpaths.c
@@ -33,9 +33,13 @@
33void paths_init(void) 33void paths_init(void)
34{ 34{
35 /* make sure $HOME/.config/rockbox.org exists, it's needed for config.cfg */ 35 /* make sure $HOME/.config/rockbox.org exists, it's needed for config.cfg */
36#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
37 mkdir("/sdcard/rockbox");
38#else
36 char home_path[MAX_PATH]; 39 char home_path[MAX_PATH];
37 snprintf(home_path, sizeof(home_path), "%s/.config/rockbox.org", getenv("HOME")); 40 snprintf(home_path, sizeof(home_path), "%s/.config/rockbox.org", getenv("HOME"));
38 mkdir(home_path); 41 mkdir(home_path);
42#endif
39} 43}
40 44
41const char* get_user_file_path(const char *path, 45const char* get_user_file_path(const char *path,
@@ -50,7 +54,11 @@ const char* get_user_file_path(const char *path,
50 pos += ROCKBOX_DIR_LEN; 54 pos += ROCKBOX_DIR_LEN;
51 if (*pos == '/') pos += 1; 55 if (*pos == '/') pos += 1;
52 56
57#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
58 if (snprintf(buf, bufsize, "/sdcard/rockbox/%s", pos)
59#else
53 if (snprintf(buf, bufsize, "%s/.config/rockbox.org/%s", getenv("HOME"), pos) 60 if (snprintf(buf, bufsize, "%s/.config/rockbox.org/%s", getenv("HOME"), pos)
61#endif
54 >= (int)bufsize) 62 >= (int)bufsize)
55 return NULL; 63 return NULL;
56 64