]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mood.c
mood: Add score value only for admissible files.
[paraslash.git] / mood.c
diff --git a/mood.c b/mood.c
index 1a572cfa8f1859a946ea34708b48e990a036f5b2..d12bc20d77554c58a77b5b2da3b4a608e5309f34 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -173,6 +173,8 @@ static int compute_mood_score(const struct osl_row *aft_row, struct mood *m,
        list_for_each_entry(item, &m->score_list, mood_item_node) {
                ret = get_item_score(item, &afsi, &afhi, path, &item_score,
                        &score_arg_sum);
+               if (ret == 0)
+                       continue;
                score += item_score;
        }
        if (score_arg_sum)
@@ -364,8 +366,10 @@ static int load_mood(const struct osl_row *mood_row, struct mood **m)
        char *mood_name;
        struct osl_object mood_def;
        struct mood_line_parser_data mlpd = {.line_num = 0};
-       int ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def);
+       int ret;
 
+       *m = NULL;
+       ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def);
        if (ret < 0)
                return ret;
        if (!*mood_name)