README: Kill "obligatory" and "optional" tags.
[paraslash.git] / mood.c
diff --git a/mood.c b/mood.c
index 77b4a7361554fa05ca36f7685114c2bd1b7ba68c..4988c685490a32a61fcb1077a090388a1bed0ac3 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -372,8 +372,11 @@ enum mood_line_type {
        ML_SCORE
 };
 
        ML_SCORE
 };
 
+/** Data passed to the parser of a mood line. */
 struct mood_line_parser_data {
 struct mood_line_parser_data {
+       /** The mood this mood line belongs to. */
        struct mood *m;
        struct mood *m;
+       /** The line number in the mood definition. */
        unsigned line_num;
 };
 
        unsigned line_num;
 };
 
@@ -419,11 +422,13 @@ static int parse_mood_line(char *mood_line, void *data)
                w++;
                if (!*w)
                        goto out;
                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;
        }
        if (mlt == ML_SCORE || !strcmp(*w, "score")) {
                ret = -E_MOOD_SYNTAX;
@@ -446,6 +451,7 @@ static int parse_mood_line(char *mood_line, void *data)
        w++;
        if (!*w)
                goto out;
        w++;
        if (!*w)
                goto out;
+check_for_if:
        if (!strcmp(*w, "if")) {
                ret = -E_MOOD_SYNTAX;
                w++;
        if (!strcmp(*w, "if")) {
                ret = -E_MOOD_SYNTAX;
                w++;