From 7bc69aa084fe3d0577303fbf6cf1569a19cde390 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Wed, 4 Jun 2003 14:18:47 +0000 Subject: Fixed %pp for shuffled dirs (patch #700465) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3726 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps-display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/wps-display.c') diff --git a/apps/wps-display.c b/apps/wps-display.c index acb839ea50..cc8009ec5c 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -414,7 +414,12 @@ static char* get_tag(struct mp3entry* id3, #endif case 'p': /* Playlist Position */ *flags |= WPS_REFRESH_STATIC; - snprintf(buf, buf_size, "%d", id3->index + 1); + { + int index = id3->index - playlist_first_index(); + if (index < 0) + index += playlist_amount(); + snprintf(buf, buf_size, "%d", index + 1); + } return buf; case 'n': /* Playlist Name (without path) */ -- cgit v1.2.3