From d4776878609698ca63c99c3db711ae3edf038bba Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 26 Oct 2007 02:21:35 +0200 Subject: [PATCH 1/1] Fix a bug in the mood line parser. The old code wouldn't work if the "if" keyword was not given. --- mood.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mood.c b/mood.c index 77b4a736..d6040f15 100644 --- a/mood.c +++ b/mood.c @@ -419,11 +419,13 @@ static int parse_mood_line(char *mood_line, void *data) w++; if (!*w) goto out; - if (!strcmp(*w, "with")) { - w++; - if (!*w) - goto out; - } + if (strcmp(*w, "with")) + goto check_for_if; + w++; + if (!*w) + goto out; + if (strcmp(*w, "score")) + goto out; } if (mlt == ML_SCORE || !strcmp(*w, "score")) { ret = -E_MOOD_SYNTAX; @@ -446,6 +448,7 @@ static int parse_mood_line(char *mood_line, void *data) w++; if (!*w) goto out; +check_for_if: if (!strcmp(*w, "if")) { ret = -E_MOOD_SYNTAX; w++; -- 2.39.2