summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorRobert Hak <adiamas@rockbox.org>2002-10-17 09:34:48 +0000
committerRobert Hak <adiamas@rockbox.org>2002-10-17 09:34:48 +0000
commit73926ef5e5dbe1a3bfd627a016c3a975cf673327 (patch)
treebdb8831fbe30b02bf1ebe85dfc85c28445ee9d08 /apps/playlist.c
parenta477dc6cf5d738ac3647919f2547d9b24dd55ef8 (diff)
downloadrockbox-73926ef5e5dbe1a3bfd627a016c3a975cf673327.tar.gz
rockbox-73926ef5e5dbe1a3bfd627a016c3a975cf673327.zip
%pn now allows for conditional checking
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2698 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 3cd40deb45..ce812c7c67 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -111,18 +111,21 @@ int playlist_first_index(void)
111 return playlist.first_index; 111 return playlist.first_index;
112} 112}
113 113
114void playlist_name(char *name, int name_size) 114char *playlist_name(char *buf, int buf_size)
115{ 115{
116 char buf[MAX_PATH+1]; 116 char *sep;
117 int i = 0; 117
118 snprintf(buf, buf_size, "%s", playlist.filename+playlist.dirlen);
118 119
119 snprintf(buf, sizeof(buf), "%s", playlist.filename+playlist.dirlen); 120 if (0 == buf[0])
120 while((buf[i] != '.') && (buf[i] != 0)) 121 return NULL;
121 i++;
122 buf[i] = 0;
123 122
124 snprintf(name, name_size, "%s", buf); 123 /* Remove extension */
125 return; 124 sep = strrchr(buf, '.');
125 if (NULL != sep)
126 *sep = 0;
127
128 return buf;
126} 129}
127 130
128int playlist_next(int steps) 131int playlist_next(int steps)