FS#5784 - Strip extension from all filetypes in playlist viewer

Patch by Nils Wallménius


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10517 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Antoine Cellerier 2006-08-10 21:08:44 +00:00
parent 585510a6c3
commit 59dc18dda0

View file

@ -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;
}