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:
parent
585510a6c3
commit
59dc18dda0
1 changed files with 5 additions and 7 deletions
|
@ -357,18 +357,16 @@ static void format_name(char* dest, const char* src)
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
/* Only display the mp3 filename */
|
/* Only display the filename */
|
||||||
char* p = strrchr(src, '/');
|
char* p = strrchr(src, '/');
|
||||||
int len;
|
|
||||||
|
|
||||||
strcpy(dest, p+1);
|
strcpy(dest, p+1);
|
||||||
len = strlen(dest);
|
|
||||||
|
|
||||||
/* Remove the extension */
|
/* Remove the extension */
|
||||||
if (!strcasecmp(&dest[len-4], ".mp3") ||
|
char* q = strrchr(dest, '.');
|
||||||
!strcasecmp(&dest[len-4], ".mp2") ||
|
|
||||||
!strcasecmp(&dest[len-4], ".mpa"))
|
if (q != NULL)
|
||||||
dest[len-4] = '\0';
|
*q = '\0';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue