summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-11-18 14:12:01 +0000
committerNils Wallménius <nils@rockbox.org>2007-11-18 14:12:01 +0000
commit4acae4da032ebd045456d3a625cc96ad4d4745d8 (patch)
tree88f634756aa1c40ebcaa4889e8b5bb4637dfc9e9 /apps
parent940fe31f8102e8723856471896e463d090354aaf (diff)
downloadrockbox-4acae4da032ebd045456d3a625cc96ad4d4745d8.zip
rockbox-4acae4da032ebd045456d3a625cc96ad4d4745d8.tar.gz
rockbox-4acae4da032ebd045456d3a625cc96ad4d4745d8.tar.bz2
rockbox-4acae4da032ebd045456d3a625cc96ad4d4745d8.tar.xz
Use the strrsplt function in one more place
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15662 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/bookmark.c16
-rw-r--r--apps/misc.c16
-rw-r--r--apps/misc.h2
-rw-r--r--apps/playlist_viewer.c5
4 files changed, 19 insertions, 20 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index e0e9f8b..3d47059 100644
--- a/apps/bookmark.c
+++ b/apps/bookmark.c
@@ -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;
diff --git a/apps/misc.c b/apps/misc.c
index d81794d..4af97af 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -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;
+}
+
diff --git a/apps/misc.h b/apps/misc.h
index b1af859..ab0e592 100644
--- a/apps/misc.h
+++ b/apps/misc.h
@@ -113,4 +113,6 @@ void setvol(void);
int hex_to_rgb(const char* hex);
#endif
+char* strrsplt(char* str, int c);
+
#endif /* MISC_H */
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 7769e68..b00e1eb 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -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;
}