mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
My previous commit broke wrap around browsing in select_bookmoark()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5121 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4341211ddc
commit
9c97f4d2a5
1 changed files with 9 additions and 8 deletions
|
|
@ -627,11 +627,8 @@ static char* select_bookmark(const char* bookmark_file_name)
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
if(bookmark_id < 0)
|
if(bookmark_id < 0)
|
||||||
{
|
bookmark_id = bookmark_count -1;
|
||||||
bookmark_id = 0;
|
if(bookmark_id >= bookmark_count)
|
||||||
bookmark_id_prev = -1;
|
|
||||||
}
|
|
||||||
if(bookmark_id == bookmark_count)
|
|
||||||
bookmark_id = 0;
|
bookmark_id = 0;
|
||||||
|
|
||||||
if (bookmark_id != bookmark_id_prev)
|
if (bookmark_id != bookmark_id_prev)
|
||||||
|
|
@ -643,7 +640,7 @@ static char* select_bookmark(const char* bookmark_file_name)
|
||||||
if (!bookmark)
|
if (!bookmark)
|
||||||
{
|
{
|
||||||
/* if there were no bookmarks in the file, delete the file and exit. */
|
/* if there were no bookmarks in the file, delete the file and exit. */
|
||||||
if(bookmark_id == 0)
|
if(bookmark_id <= 0)
|
||||||
{
|
{
|
||||||
splash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY));
|
splash(HZ, true, str(LANG_BOOKMARK_LOAD_EMPTY));
|
||||||
remove(bookmark_file_name);
|
remove(bookmark_file_name);
|
||||||
|
|
@ -684,9 +681,10 @@ static char* select_bookmark(const char* bookmark_file_name)
|
||||||
#endif
|
#endif
|
||||||
/* User wants to delete this bookmark */
|
/* User wants to delete this bookmark */
|
||||||
delete_bookmark(bookmark_file_name, bookmark_id);
|
delete_bookmark(bookmark_file_name, bookmark_id);
|
||||||
bookmark_id_prev=-1;
|
bookmark_id_prev=-2;
|
||||||
bookmark_id--;
|
|
||||||
bookmark_count--;
|
bookmark_count--;
|
||||||
|
if(bookmark_id >= bookmark_count)
|
||||||
|
bookmark_id = bookmark_count -1;
|
||||||
while (button_get(false)); /* clear button queue */
|
while (button_get(false)); /* clear button queue */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -951,6 +949,9 @@ static char* get_bookmark(const char* bookmark_file, int bookmark_count)
|
||||||
if (file < 0)
|
if (file < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (bookmark_count < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Get the requested bookmark */
|
/* Get the requested bookmark */
|
||||||
while (read_count < bookmark_count)
|
while (read_count < bookmark_count)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue