- if (ret < 0)
- para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num,
- para_strerror(-ret));
+ if (ret < 0) {
+ char *errmsg;
+ struct mood *m = alloc_new_mood("check");
+ ret = mp_init(mood_def.data, mood_def.size, &m->parser_context,
+ &errmsg);
+ if (ret < 0) {
+ para_printf(pb, "%s: %s\n", mood_name, errmsg);
+ free(errmsg);
+ para_printf(pb, "%s\n", para_strerror(-ret));
+ } else
+ destroy_mood(m);
+ } else {
+ para_printf(pb, "%s: v1 mood, please convert to v2\n",
+ mood_name);
+
+ }
+ ret = 1; /* don't fail the loop on invalid mood definitions */