1
0
Fork 0
forked from len0rd/rockbox

Added backslash and drive letter support

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1029 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-06-17 10:17:50 +00:00
parent 0530349c1f
commit 5a8a5b54f5

View file

@ -39,6 +39,7 @@ char* playlist_next(int type)
int seek = playlist.indices[playlist.index]; int seek = playlist.indices[playlist.index];
int max; int max;
int fd; int fd;
int i;
(void)type; /* prevent compiler warning until this is gets used */ (void)type; /* prevent compiler warning until this is gets used */
playlist.index = (playlist.index+1) % playlist.amount; playlist.index = (playlist.index+1) % playlist.amount;
@ -57,12 +58,22 @@ char* playlist_next(int type)
seek++; seek++;
now_playing[seek]=0; 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]) if('/' == now_playing[1])
return &now_playing[1]; return &now_playing[1];
else { else {
now_playing[0]='/'; /* handle dos style drive letter */
return now_playing; if ( ':' == now_playing[2] )
return &now_playing[3];
else {
now_playing[0]='/';
return now_playing;
}
} }
} }
else else