diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2004-08-31 23:44:24 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2004-08-31 23:44:24 +0000 |
| commit | 943ac26cf6fdc2676ca4ee8ffc5c25a4fb58da6e (patch) | |
| tree | cc8af67acaddab517823772194039561ba409ef8 /apps | |
| parent | 3e41780d44ff361ea4ad1a4472d44461e06be4cc (diff) | |
| download | rockbox-943ac26cf6fdc2676ca4ee8ffc5c25a4fb58da6e.zip rockbox-943ac26cf6fdc2676ca4ee8ffc5c25a4fb58da6e.tar.gz rockbox-943ac26cf6fdc2676ca4ee8ffc5c25a4fb58da6e.tar.bz2 rockbox-943ac26cf6fdc2676ca4ee8ffc5c25a4fb58da6e.tar.xz | |
Reverted an erroneous const, and fixed & optimized relative path handling. The bug didn't show up because FAT is inherently able to handle relative paths itself.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5028 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/playlist.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index fa663fe..d147226 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -156,7 +156,7 @@ static int compare(const void* p1, const void* p2); static int get_filename(struct playlist_info* playlist, int seek, bool control_file, char *buf, int buf_length); static int format_track_path(char *dest, char *src, int buf_length, int max, - const char *dir); + char *dir); static void display_playlist_count(int count, const char *fmt); static void display_buffer_full(void); static int flush_pending_control(struct playlist_info* playlist); @@ -972,7 +972,7 @@ static int get_filename(struct playlist_info* playlist, int seek, * Returns absolute path of track */ static int format_track_path(char *dest, char *src, int buf_length, int max, - const char *dir) + char *dir) { int i = 0; int j; @@ -1005,13 +1005,11 @@ static int format_track_path(char *dest, char *src, int buf_length, int max, /* handle dos style drive letter */ if (':' == src[1]) strncpy(dest, &src[2], buf_length); - else if ('.' == src[0] && '.' == src[1] && '/' == src[2]) + else if (!strncmp(src, "../", 3)) { /* handle relative paths */ i=3; - while(src[i] == '.' && - src[i] == '.' && - src[i] == '/') + while(!strncmp(&src[i], "../", 3)) i += 3; for (j=0; j<i/3; j++) { temp_ptr = strrchr(dir, '/'); |