diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-22 02:13:26 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-22 02:13:26 -0700 |
commit | 51405e174f4ea1ee58610012837241c928335057 (patch) | |
tree | ce8397587182e7c427e23b34e2016832ef11c1a0 /src/command.c | |
parent | 77f98f37245f7d8ea2b0182b326420b6d6455cad (diff) | |
parent | 88424d256390e9c8aad24ed185381dc1297f51d5 (diff) | |
download | mpd-51405e174f4ea1ee58610012837241c928335057.tar.gz mpd-51405e174f4ea1ee58610012837241c928335057.tar.xz mpd-51405e174f4ea1ee58610012837241c928335057.zip |
Merge branch 'ew/directory'
* ew/directory:
songvec: remove songvec_prune
directory: update do its work inside a thread
directory: use enum update_return for return values
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/command.c b/src/command.c index ebca41bde..f5996c576 100644 --- a/src/command.c +++ b/src/command.c @@ -805,13 +805,10 @@ static int listHandleUpdate(int fd, char *argv[], struct strnode *cmdnode, CommandEntry * cmd) { - static List *pathList; + List *pathList = makeList(NULL, 1); CommandEntry *nextCmd = NULL; struct strnode *next = cmdnode->next; - if (!pathList) - pathList = makeList(NULL, 1); - if (argc == 2) insertInList(pathList, argv[1], NULL); else @@ -820,12 +817,8 @@ static int listHandleUpdate(int fd, if (next) nextCmd = getCommandEntryFromString(next->data, permission); - if (cmd != nextCmd) { - int ret = updateInit(fd, pathList); - freeList(pathList); - pathList = NULL; - return ret; - } + if (cmd != nextCmd) + return updateInit(fd, pathList); return 0; } @@ -834,12 +827,9 @@ static int handleUpdate(int fd, mpd_unused int *permission, mpd_unused int argc, char *argv[]) { if (argc == 2) { - int ret; List *pathList = makeList(NULL, 1); insertInList(pathList, argv[1], NULL); - ret = updateInit(fd, pathList); - freeList(pathList); - return ret; + return updateInit(fd, pathList); } return updateInit(fd, NULL); } |