diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-06-17 10:17:50 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-06-17 10:17:50 +0000 |
| commit | 5a8a5b54f550f3778b30e4ff380c57f18473da8d (patch) | |
| tree | 4e46537afdf240fbda5bd1285b0e6743d77685d7 | |
| parent | 0530349c1f0c118bfb72e378ae88d85ce88fc5bf (diff) | |
| download | rockbox-5a8a5b54f550f3778b30e4ff380c57f18473da8d.zip rockbox-5a8a5b54f550f3778b30e4ff380c57f18473da8d.tar.gz rockbox-5a8a5b54f550f3778b30e4ff380c57f18473da8d.tar.bz2 rockbox-5a8a5b54f550f3778b30e4ff380c57f18473da8d.tar.xz | |
Added backslash and drive letter support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1029 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playlist.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 2e21aef..942a578 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -39,6 +39,7 @@ char* playlist_next(int type) int seek = playlist.indices[playlist.index]; int max; int fd; + int i; (void)type; /* prevent compiler warning until this is gets used */ playlist.index = (playlist.index+1) % playlist.amount; @@ -57,12 +58,22 @@ char* playlist_next(int type) seek++; now_playing[seek]=0; + + /* replace backslashes with forward slashes */ + for ( i=1; i<seek; i++ ) + if ( now_playing[i] == '\\' ) + now_playing[i] = '/'; if('/' == now_playing[1]) return &now_playing[1]; else { - now_playing[0]='/'; - return now_playing; + /* handle dos style drive letter */ + if ( ':' == now_playing[2] ) + return &now_playing[3]; + else { + now_playing[0]='/'; + return now_playing; + } } } else |