From: Andre Noll Date: Fri, 26 Oct 2007 00:21:35 +0000 (+0200) Subject: Fix a bug in the mood line parser. X-Git-Tag: v0.3.0~193 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=d4776878609698ca63c99c3db711ae3edf038bba;p=paraslash.git Fix a bug in the mood line parser. The old code wouldn't work if the "if" keyword was not given. --- 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++;