From: Mark Wooding Date: Sun, 5 May 2013 13:51:05 +0000 (+0100) Subject: lib/configuration.c: Allow resetting `player' and `tracklength' lists. X-Git-Tag: 5.1.1~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/ec554a3df7afe6a7b890983e75e81bc3aa17cb55 lib/configuration.c: Allow resetting `player' and `tracklength' lists. Saith the manual | If player is used without arguments, the list of players is cleared. but the code disallows such requests. So it's impossible to override the player lists. --- diff --git a/lib/configuration.c b/lib/configuration.c index 4f21d25..351b151 100644 --- a/lib/configuration.c +++ b/lib/configuration.c @@ -697,7 +697,7 @@ static int validate_isreg(const struct config_state *cs, static int validate_player(const struct config_state *cs, int nvec, char attribute((unused)) **vec) { - if(nvec < 2) { + if(nvec && nvec < 2) { disorder_error(0, "%s:%d: should be at least 'player PATTERN MODULE'", cs->path, cs->line); return -1; @@ -714,7 +714,7 @@ static int validate_player(const struct config_state *cs, static int validate_tracklength(const struct config_state *cs, int nvec, char attribute((unused)) **vec) { - if(nvec < 2) { + if(nvec && nvec < 2) { disorder_error(0, "%s:%d: should be at least 'tracklength PATTERN MODULE'", cs->path, cs->line); return -1;