From 59dc18dda092c0ca705107c882c168324f6941bc Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Thu, 10 Aug 2006 21:08:44 +0000 Subject: [PATCH] =?UTF-8?q?FS#5784=20-=20Strip=20extension=20from=20all=20?= =?UTF-8?q?filetypes=20in=20playlist=20viewer=20Patch=20by=20Nils=20Wallm?= =?UTF-8?q?=C3=A9nius?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10517 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist_viewer.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 087bdd1583..6c21cc4a99 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -357,18 +357,16 @@ static void format_name(char* dest, const char* src) case 0: default: { - /* Only display the mp3 filename */ + /* Only display the filename */ char* p = strrchr(src, '/'); - int len; strcpy(dest, p+1); - len = strlen(dest); /* Remove the extension */ - if (!strcasecmp(&dest[len-4], ".mp3") || - !strcasecmp(&dest[len-4], ".mp2") || - !strcasecmp(&dest[len-4], ".mpa")) - dest[len-4] = '\0'; + char* q = strrchr(dest, '.'); + + if (q != NULL) + *q = '\0'; break; }