summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/main.c b/apps/main.c
index 6c6d09cbaa..67cd6d2f0d 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -131,6 +131,9 @@ static void init(void);
131#endif 131#endif
132int main(int argc, char *argv[]) 132int main(int argc, char *argv[])
133{ 133{
134#ifdef APPLICATION
135 paths_init();
136#endif
134 sys_handle_argv(argc, argv); 137 sys_handle_argv(argc, argv);
135#else 138#else
136/* main(), and various functions called by main() and init() may be 139/* main(), and various functions called by main() and init() may be
@@ -163,11 +166,17 @@ int main(void)
163 166
164#ifdef AUTOROCK 167#ifdef AUTOROCK
165 { 168 {
166 static const char filename[] = PLUGIN_APPS_DIR "/autostart.rock"; 169 char filename[MAX_PATH];
167 170 const char *file = get_user_file_path(
168 if(file_exists(filename)) /* no complaint if it doesn't exist */ 171#ifdef APPLICATION
172 ROCKBOX_DIR
173#else
174 PLUGIN_APPS_DIR
175#endif
176 "/autostart.rock", NEED_WRITE|IS_FILE, filename, sizeof(filename));
177 if(file_exists(file)) /* no complaint if it doesn't exist */
169 { 178 {
170 plugin_load((char*)filename, NULL); /* start if it does */ 179 plugin_load(file, NULL); /* start if it does */
171 } 180 }
172 } 181 }
173#endif /* #ifdef AUTOROCK */ 182#endif /* #ifdef AUTOROCK */