From 00a228fefbfc9058b89ba914755aa9d5f31da085 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 16 Oct 2008 11:11:45 +0000 Subject: Accept FS#7482 by Klaas Bosteels - return the full path of a file which doesnt have valid tags yet (and use the end of the filename for the title) instead of before which was only using the filename git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18820 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'apps') diff --git a/apps/playback.c b/apps/playback.c index c7c0b5e9c4..f41cca64a2 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -559,7 +559,6 @@ int audio_current_aa_hid(void) struct mp3entry* audio_current_track(void) { const char *filename; - const char *p; static struct mp3entry temp_id3; struct playlist_track_info trackinfo; int cur_idx; @@ -602,14 +601,12 @@ struct mp3entry* audio_current_track(void) return &temp_id3; #endif - p = strrchr(filename, '/'); - if (!p) - p = filename; + strncpy(temp_id3.path, filename, sizeof(temp_id3.path)-1); + temp_id3.title = strrchr(temp_id3.path, '/'); + if (!temp_id3.title) + temp_id3.title = &temp_id3.path[0]; else - p++; - - strncpy(temp_id3.path, p, sizeof(temp_id3.path)-1); - temp_id3.title = &temp_id3.path[0]; + temp_id3.title++; return &temp_id3; } -- cgit v1.2.3