From 30ceda2640277ee8c6f7f96e4fa86545932f1c9c Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Mon, 20 Aug 2007 14:34:16 +0000 Subject: just testing3 git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6775 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/ls.c | 11 ++--------- src/storedPlaylist.c | 2 +- src/storedPlaylist.h | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/ls.c b/src/ls.c index 2e17654b5..6f0b29a4e 100644 --- a/src/ls.c +++ b/src/ls.c @@ -167,17 +167,10 @@ int lsPlaylists(int fd, char *utf8path) node = list->firstNode; while (node != NULL) { if (!strchr(node->key, '\n')) { - s[MAXPATHLEN] = '\0'; - /* this is safe, notice actlen > MAXPATHLEN-1 above */ - strcpy(s, actualPath); - strcat(s, "/"); - strcat(s, node->key); - strcat(s,"."); - strcat(s, PLAYLIST_FILE_SUFFIX); + char *filename = utf8pathToFsPathInStoredPlaylist(utf8path, fd); fdprintf(fd, "playlist: %s%s\n", dup, node->key); - fdprintf(fd, "full path: %s\n", s); - if(myStat(s, &data)) + if(myStat(filename, &data) == 0) { fdprintf(fd, "mtime: %li\n", data.st_mtime); } diff --git a/src/storedPlaylist.c b/src/storedPlaylist.c index 3e2fdf827..0f1160aa0 100644 --- a/src/storedPlaylist.c +++ b/src/storedPlaylist.c @@ -42,7 +42,7 @@ unsigned long getStoredPlaylistVersion(void) return storedplaylistversion; } -static char *utf8pathToFsPathInStoredPlaylist(const char *utf8path, int fd) +char *utf8pathToFsPathInStoredPlaylist(const char *utf8path, int fd) { char *file; char *rfile; diff --git a/src/storedPlaylist.h b/src/storedPlaylist.h index 55387742f..4a929419e 100644 --- a/src/storedPlaylist.h +++ b/src/storedPlaylist.h @@ -46,5 +46,5 @@ void appendPlaylistToStoredPlaylist(StoredPlaylist *sp, Playlist *playlist); int renameStoredPlaylist(int fd, const char *utf8from, const char *utf8to); unsigned long getStoredPlaylistVersion(void); - +char *utf8pathToFsPathInStoredPlaylist(const char *utf8path, int fd); #endif -- cgit v1.2.3