diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings.c | 11 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_menu.c | 4 |
3 files changed, 10 insertions, 7 deletions
diff --git a/apps/settings.c b/apps/settings.c index b08ed8475d..1cde6e02e7 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -544,7 +544,7 @@ void settings_apply(void) #ifdef HAVE_LCD_BITMAP if ( global_settings.font_file[0] && global_settings.font_file[0] != 0xff ) { - snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.fnt", + snprintf(buf, sizeof buf, ROCKBOX_DIR FONT_DIR "/%s.fnt", global_settings.font_file); font_load(buf); } @@ -561,7 +561,7 @@ void settings_apply(void) if ( global_settings.lang_file[0] && global_settings.lang_file[0] != 0xff ) { - snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.lng", + snprintf(buf, sizeof buf, ROCKBOX_DIR LANG_DIR "/%s.lng", global_settings.lang_file); lang_load(buf); } @@ -829,7 +829,8 @@ void set_file(char* filename, char* setting, int maxlen) ptr--; } - if (strcmp(ROCKBOX_DIR, filename) || (len-extlen > maxlen)) + if (strncmp(ROCKBOX_DIR, filename ,strlen(ROCKBOX_DIR)) || + (len-extlen > maxlen)) return; strncpy(setting, fptr, len-extlen); @@ -1187,12 +1188,12 @@ bool settings_save_config(void) global_settings.wps_file); if (global_settings.lang_file[0] != 0) - fprintf(fd, "lang: %s/%s.lng\r\n", ROCKBOX_DIR, + fprintf(fd, "lang: %s/%s.lng\r\n", ROCKBOX_DIR LANG_DIR, global_settings.lang_file); #ifdef HAVE_LCD_BITMAP if (global_settings.font_file[0] != 0) - fprintf(fd, "font: %s/%s.fnt\r\n", ROCKBOX_DIR, + fprintf(fd, "font: %s/%s.fnt\r\n", ROCKBOX_DIR FONT_DIR, global_settings.font_file); #endif diff --git a/apps/settings.h b/apps/settings.h index 49327b2f80..904bcd6a91 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -25,6 +25,8 @@ #include "file.h" #define ROCKBOX_DIR "/.rockbox" +#define FONT_DIR "/fonts" +#define LANG_DIR "/langs" #define PLUGIN_DIR ROCKBOX_DIR"/rocks" #define MAX_FILENAME 20 diff --git a/apps/settings_menu.c b/apps/settings_menu.c index c3932f3264..65261e348c 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -731,13 +731,13 @@ static bool custom_cfg_browse(void) static bool language_browse(void) { - return rockbox_browse(ROCKBOX_DIR, SHOW_LNG); + return rockbox_browse(ROCKBOX_DIR LANG_DIR, SHOW_LNG); } #ifdef HAVE_RECORDER_KEYPAD static bool font_browse(void) { - return rockbox_browse(ROCKBOX_DIR, SHOW_FONT); + return rockbox_browse(ROCKBOX_DIR FONT_DIR, SHOW_FONT); } #endif |