From 6db819cefead7e0c0ae38c592331e74b507d9429 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 3 May 2005 02:35:19 +0000 Subject: 'add' command now requires one argument git-svn-id: https://svn.musicpd.org/mpd/trunk@3236 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/command.c | 10 ++++------ 1 file 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); -- cgit v1.2.3