Use the strrsplt function in one more place

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15662 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2007-11-18 14:12:01 +00:00
parent 940fe31f81
commit 4acae4da03
4 changed files with 19 additions and 20 deletions

View File

@ -508,22 +508,6 @@ static int buffer_bookmarks(struct bookmark_list* bookmarks, int first_line)
return bookmarks->start + bookmarks->count;
}
static char* strrsplt(char* str, int c)
{
char* s = strrchr(str, c);
if (s != NULL)
{
*s++ = '\0';
}
else
{
s = str;
}
return s;
}
static char* get_bookmark_info(int list_index, void* data, char *buffer)
{
struct bookmark_list* bookmarks = (struct bookmark_list*) data;

View File

@ -1076,3 +1076,19 @@ int hex_to_rgb(const char* hex)
}
#endif /* HAVE_LCD_COLOR */
char* strrsplt(char* str, int c)
{
char* s = strrchr(str, c);
if (s != NULL)
{
*s++ = '\0';
}
else
{
s = str;
}
return s;
}

View File

@ -113,4 +113,6 @@ void setvol(void);
int hex_to_rgb(const char* hex);
#endif
char* strrsplt(char* str, int c);
#endif /* MISC_H */

View File

@ -372,10 +372,7 @@ static void format_name(char* dest, const char* src)
strcpy(dest, p+1);
/* Remove the extension */
char* q = strrchr(dest, '.');
if (q != NULL)
*q = '\0';
strrsplt(dest, '.');
break;
}