diff options
| author | Antoine Cellerier <dionoea@videolan.org> | 2006-08-10 21:08:44 +0000 |
|---|---|---|
| committer | Antoine Cellerier <dionoea@videolan.org> | 2006-08-10 21:08:44 +0000 |
| commit | 59dc18dda092c0ca705107c882c168324f6941bc (patch) | |
| tree | 6b7e881fabf688843e496123ab9e120ba2c5dc63 /apps | |
| parent | 585510a6c31d2e11d89ca5e76ed1d713e9811028 (diff) | |
| download | rockbox-59dc18dda092c0ca705107c882c168324f6941bc.zip rockbox-59dc18dda092c0ca705107c882c168324f6941bc.tar.gz rockbox-59dc18dda092c0ca705107c882c168324f6941bc.tar.bz2 rockbox-59dc18dda092c0ca705107c882c168324f6941bc.tar.xz | |
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
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/playlist_viewer.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 087bdd1..6c21cc4 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; } |