aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ls.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ls.c b/src/ls.c
index e62ed046b..a01dd0872 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -167,9 +167,17 @@ int lsPlaylists(int fd, char *utf8path)
node = list->firstNode;
while (node != NULL) {
if (!strchr(node->key, '\n')) {
- myStat(node->key, &data);
+ s[MAXPATHLEN] = '\0';
+ /* this is safe, notice actlen > MAXPATHLEN-1 above */
+ strcpy(s, actualPath);
+ strcat(s, "/");
+ strcat(s, node->key);
+
fdprintf(fd, "playlist: %s%s\n", dup, node->key);
- fdprintf(fd, "mtime: %li\n", data.st_mtime);
+ if(myStat(s, &data))
+ {
+ fdprintf(fd, "mtime: %li\n", data.st_mtime);
+ }
}
node = node->nextNode;
}