From: Andre Noll Date: Sun, 9 Jul 2017 21:31:43 +0000 (+0200) Subject: mood.c: Don't try twice to activate an invalid mood. X-Git-Tag: v0.6.1~23 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=6c6065477926396a7e70f000a1cbe222ecd65be4;p=paraslash.git mood.c: Don't try twice to activate an invalid mood. (Re-)loading a mood by executing the "select" server command fails if the mood definition is invalid. In this case we first try to switch back to the old mood, and if this also fails, fall back to the dummy mood. If the mood which is currently active has been replaced by an invalid mood, switching back to the old mood is pointless because this will try to load the same invalid mood again. This commit modifies the select callback to load the old mood only if it is different from the new mood. --- diff --git a/afs.c b/afs.c index fc93675a..4857f9bc 100644 --- a/afs.c +++ b/afs.c @@ -580,7 +580,7 @@ static int com_select_callback(struct afs_callback_arg *aca) goto out; /* ignore subsequent errors (but log them) */ para_printf(&aca->pbout, "could not activate %s\n", arg); - if (current_mop) { + if (current_mop && strcmp(current_mop, arg) != 0) { int ret2; para_printf(&aca->pbout, "switching back to %s\n", current_mop); ret2 = activate_mood_or_playlist(current_mop, &num_admissible);