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 /apps | |
parent | 0530349c1f0c118bfb72e378ae88d85ce88fc5bf (diff) | |
download | rockbox-5a8a5b54f550f3778b30e4ff380c57f18473da8d.tar.gz rockbox-5a8a5b54f550f3778b30e4ff380c57f18473da8d.zip |
Added backslash and drive letter support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1029 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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 2e21aef717..942a5785b1 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -39,6 +39,7 @@ char* playlist_next(int type) | |||
39 | int seek = playlist.indices[playlist.index]; | 39 | int seek = playlist.indices[playlist.index]; |
40 | int max; | 40 | int max; |
41 | int fd; | 41 | int fd; |
42 | int i; | ||
42 | (void)type; /* prevent compiler warning until this is gets used */ | 43 | (void)type; /* prevent compiler warning until this is gets used */ |
43 | 44 | ||
44 | playlist.index = (playlist.index+1) % playlist.amount; | 45 | playlist.index = (playlist.index+1) % playlist.amount; |
@@ -57,12 +58,22 @@ char* playlist_next(int type) | |||
57 | seek++; | 58 | seek++; |
58 | 59 | ||
59 | now_playing[seek]=0; | 60 | now_playing[seek]=0; |
61 | |||
62 | /* replace backslashes with forward slashes */ | ||
63 | for ( i=1; i<seek; i++ ) | ||
64 | if ( now_playing[i] == '\\' ) | ||
65 | now_playing[i] = '/'; | ||
60 | 66 | ||
61 | if('/' == now_playing[1]) | 67 | if('/' == now_playing[1]) |
62 | return &now_playing[1]; | 68 | return &now_playing[1]; |
63 | else { | 69 | else { |
64 | now_playing[0]='/'; | 70 | /* handle dos style drive letter */ |
65 | return now_playing; | 71 | if ( ':' == now_playing[2] ) |
72 | return &now_playing[3]; | ||
73 | else { | ||
74 | now_playing[0]='/'; | ||
75 | return now_playing; | ||
76 | } | ||
66 | } | 77 | } |
67 | } | 78 | } |
68 | else | 79 | else |