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/playlist_viewer.c | |
parent | 585510a6c31d2e11d89ca5e76ed1d713e9811028 (diff) | |
download | rockbox-59dc18dda092c0ca705107c882c168324f6941bc.tar.gz rockbox-59dc18dda092c0ca705107c882c168324f6941bc.zip |
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/playlist_viewer.c')
-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 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) | |||
357 | case 0: | 357 | case 0: |
358 | default: | 358 | default: |
359 | { | 359 | { |
360 | /* Only display the mp3 filename */ | 360 | /* Only display the filename */ |
361 | char* p = strrchr(src, '/'); | 361 | char* p = strrchr(src, '/'); |
362 | int len; | ||
363 | 362 | ||
364 | strcpy(dest, p+1); | 363 | strcpy(dest, p+1); |
365 | len = strlen(dest); | ||
366 | 364 | ||
367 | /* Remove the extension */ | 365 | /* Remove the extension */ |
368 | if (!strcasecmp(&dest[len-4], ".mp3") || | 366 | char* q = strrchr(dest, '.'); |
369 | !strcasecmp(&dest[len-4], ".mp2") || | 367 | |
370 | !strcasecmp(&dest[len-4], ".mpa")) | 368 | if (q != NULL) |
371 | dest[len-4] = '\0'; | 369 | *q = '\0'; |
372 | 370 | ||
373 | break; | 371 | break; |
374 | } | 372 | } |