aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-05-03 02:35:19 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-05-03 02:35:19 +0000
commit6db819cefead7e0c0ae38c592331e74b507d9429 (patch)
treee4e237b6a0d43c7ecb47b1347bad3daa8b982731 /src
parenta97110661c26049d73f2fa6fe2f80372fb047ee4 (diff)
downloadmpd-6db819cefead7e0c0ae38c592331e74b507d9429.tar.gz
mpd-6db819cefead7e0c0ae38c592331e74b507d9429.tar.xz
mpd-6db819cefead7e0c0ae38c592331e74b507d9429.zip
'add' command now requires one argument
git-svn-id: https://svn.musicpd.org/mpd/trunk@3236 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/command.c b/src/command.c
index 2c307e0bb..02d0ae3b7 100644
--- a/src/command.c
+++ b/src/command.c
@@ -297,12 +297,10 @@ int handleClose(FILE * fp, unsigned int * permission, int argArrayLength,
int handleAdd(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray)
{
- char * path = NULL;
+ char * path = argArray[1];
+
+ if(isRemoteUrl(path)) return addToPlaylist(fp, path, 0);
- if(argArrayLength == 2) {
- path = argArray[1];
- if(isRemoteUrl(path)) return addToPlaylist(fp, path, 0);
- }
return addAllIn(fp,path);
}
@@ -922,7 +920,7 @@ void initCommands() {
addCommand(COMMAND_STATUS ,PERMISSION_READ, 0, 0,commandStatus,NULL);
addCommand(COMMAND_KILL ,PERMISSION_ADMIN, -1,-1,handleKill,NULL);
addCommand(COMMAND_CLOSE ,0, -1,-1,handleClose,NULL);
- addCommand(COMMAND_ADD ,PERMISSION_ADD, 0, 1,handleAdd,NULL);
+ addCommand(COMMAND_ADD ,PERMISSION_ADD, 1, 1,handleAdd,NULL);
addCommand(COMMAND_ADDID ,PERMISSION_ADD, 0, 1,handleAddId,NULL);
addCommand(COMMAND_DELETE ,PERMISSION_CONTROL, 1, 1,handleDelete,NULL);
addCommand(COMMAND_DELETEID ,PERMISSION_CONTROL, 1, 1,handleDeleteId,NULL);