summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorHenrik Backe <henrik@backe.eu>2004-03-21 13:42:18 +0000
committerHenrik Backe <henrik@backe.eu>2004-03-21 13:42:18 +0000
commit0e90bc3f09969b6887f83ef5b6c2e1916672b2f3 (patch)
tree238332a8412956c05fecb463caddc6a7605b3a27 /apps/bookmark.c
parent48ac52c7d1b8d1ba23de8045d5f25aea40afa37a (diff)
downloadrockbox-0e90bc3f09969b6887f83ef5b6c2e1916672b2f3.tar.gz
rockbox-0e90bc3f09969b6887f83ef5b6c2e1916672b2f3.tar.bz2
rockbox-0e90bc3f09969b6887f83ef5b6c2e1916672b2f3.zip
To many bookmarks could be delete when unique only was set
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4422 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index b4a2cd566a..e62448c64a 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -343,6 +343,7 @@ static bool add_bookmark(char* bookmark_file_name, char* bookmark)
int bookmark_count = 0;
char* playlist = NULL;
char* cp;
+ char* tmp;
int len = 0;
bool unique = false;
@@ -383,27 +384,15 @@ static bool add_bookmark(char* bookmark_file_name, char* bookmark)
break;
}
- if (unique)
+ cp = strchr(global_read_buffer,'/');
+ tmp = strrchr(global_read_buffer,';');
+ if (check_bookmark(global_read_buffer) &&
+ (!unique || len != tmp -cp || strncmp(playlist,cp,len)))
{
- cp=strchr(global_read_buffer,'/');
- if (check_bookmark(global_read_buffer) &&
- strncmp(playlist,cp,len))
- {
- bookmark_count++;
- write(temp_bookmark_file, global_read_buffer,
- strlen(global_read_buffer));
- write(temp_bookmark_file, "\n", 1);
- }
- }
- else
- {
- if (check_bookmark(global_read_buffer))
- {
- bookmark_count++;
- write(temp_bookmark_file, global_read_buffer,
- strlen(global_read_buffer));
- write(temp_bookmark_file, "\n", 1);
- }
+ bookmark_count++;
+ write(temp_bookmark_file, global_read_buffer,
+ strlen(global_read_buffer));
+ write(temp_bookmark_file, "\n", 1);
}
}
close(bookmark_file);