aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/command.c b/src/command.c
index 518bf5f0d..04e85c6fe 100644
--- a/src/command.c
+++ b/src/command.c
@@ -571,7 +571,7 @@ static int handleLsInfo(int fd, mpd_unused int *permission,
directory_print(fd, dir);
- if (isRootDirectory(path))
+ if (dir == &music_root)
return lsPlaylists(fd, path);
return 0;
@@ -802,9 +802,15 @@ static int handleUpdate(int fd, mpd_unused int *permission,
char *path = NULL;
assert(argc <= 2);
- if (argc == 2 && !(path = sanitizePathDup(argv[1]))) {
- commandError(fd, ACK_ERROR_ARG, "invalid path");
- return -1;
+ if (argc == 2) {
+ if (!(path = sanitizePathDup(argv[1]))) {
+ commandError(fd, ACK_ERROR_ARG, "invalid path");
+ return -1;
+ }
+ if (path_is_music_root(path)) {
+ free(path);
+ path = NULL;
+ }
}
return print_update_result(fd, directory_update_init(path));
}