Don't list playlists in lsinfo if the path isn't the root directory (they

can't be loaded anyway).

git-svn-id: https://svn.musicpd.org/mpd/trunk@6244 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman
2007-05-24 17:06:59 +00:00
parent 93b96edacc
commit c408bd5e90
3 changed files with 23 additions and 12 deletions

View File

@@ -402,17 +402,18 @@ static int handleListPlaylistInfo(int fd, int *permission,
static int handleLsInfo(int fd, int *permission, int argc, char *argv[])
{
if (argc == 1) {
if (printDirectoryInfo(fd, NULL) < 0)
return -1;
else
return lsPlaylists(fd, "");
} else {
if (printDirectoryInfo(fd, argv[1]) < 0)
return -1;
else
return lsPlaylists(fd, argv[1]);
}
char *path = "";
if (argc == 2)
path = argv[1];
if (printDirectoryInfo(fd, path) < 0)
return -1;
if (isRootDirectory(path))
return lsPlaylists(fd, path);
return 0;
}
static int handleRm(int fd, int *permission, int argc, char *argv[])