diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-05 13:29:50 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-05 13:29:50 +0000 |
commit | 3d43828f538b96100ef468c4476142987652f82b (patch) | |
tree | 3eb09748095ef0451253e561cee54439186f1e6d /apps/plugins/viewer.c | |
parent | 608e53d10f408dc4a433adb96e1567ef3ffa592a (diff) | |
download | rockbox-3d43828f538b96100ef468c4476142987652f82b.tar.gz rockbox-3d43828f538b96100ef468c4476142987652f82b.zip |
fix FS#6621 - viewer bookmarks only working for one file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12207 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/viewer.c')
-rw-r--r-- | apps/plugins/viewer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 8590283c57..543b5c0d1d 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c | |||
@@ -1095,13 +1095,14 @@ static void viewer_load_settings(void) /* same name as global, but not the same | |||
1095 | settings_fd = rb->creat(BOOKMARKS_FILE); | 1095 | settings_fd = rb->creat(BOOKMARKS_FILE); |
1096 | if (settings_fd >=0 ) | 1096 | if (settings_fd >=0 ) |
1097 | { | 1097 | { |
1098 | if (++(data->bookmarked_files_count) > MAX_BOOKMARKED_FILES) | 1098 | if ((data->bookmarked_files_count + 1) > MAX_BOOKMARKED_FILES) |
1099 | data->bookmarked_files_count = MAX_BOOKMARKED_FILES; /* dump the older files */ | 1099 | data->bookmarked_files_count = MAX_BOOKMARKED_FILES; /* dump the older files */ |
1100 | else data->bookmarked_files_count++; | ||
1100 | rb->write (settings_fd, &data->bookmarked_files_count, sizeof(signed int)); | 1101 | rb->write (settings_fd, &data->bookmarked_files_count, sizeof(signed int)); |
1101 | rb->PREFIX(lseek)(settings_fd,sizeof(struct bookmarked_file_info),SEEK_CUR); | 1102 | rb->PREFIX(lseek)(settings_fd,sizeof(struct bookmarked_file_info),SEEK_CUR); |
1102 | // rb->memset(&dummy,0,sizeof(struct bookmarked_file_info)); /* the actual info will be written on exit */ | 1103 | // rb->memset(&dummy,0,sizeof(struct bookmarked_file_info)); /* the actual info will be written on exit */ |
1103 | //rb->write (settings_fd, &dummy, sizeof(struct bookmarked_file_info)); | 1104 | //rb->write (settings_fd, &dummy, sizeof(struct bookmarked_file_info)); |
1104 | rb->write (settings_fd, data->bookmarks, sizeof(struct bookmarked_file_info)*(data->bookmarked_files_count-1)); | 1105 | rb->write (settings_fd, data->bookmarks, sizeof(struct bookmarked_file_info)*(data->bookmarked_files_count)); |
1105 | rb->close(settings_fd); | 1106 | rb->close(settings_fd); |
1106 | } | 1107 | } |
1107 | } | 1108 | } |