" : Line %d, col %d of file %s\n%s\n"),
buf, lc->line_no, lc->col_no, lc->fname, lc->line);
}
+
+ lc->last_result = -1;
}
/* Reset free items */
} else {
e_msg(file, line, lc->err_type, 0, _("Config error: %s\n"), buf);
}
+
+ lc->last_result = -1;
}
void lex_set_default_error_handler(LEX *lf)
uint64_t pint64_val2;
void (*scan_error)(const char *file, int line, struct s_lex_context *lc, const char *msg, ...);
int err_type; /* message level for scan_error (M_..) */
+ /* TODO change the config scanning helpers to be non-void, add handling of it's return value */
+ int last_result; /* Result of last scanning. Error code is set whenerver any of the
+ 'scan_err' macros is called. */
void *caller_ctx; /* caller private data */
BPIPE *bpipe; /* set if we are piping */
} LEX;
Dmsg1(800, "calling handler for %s\n", items[i].name);
/* Call item handler */
items[i].handler(lc, &items[i], i, pass);
+ if (lc->last_result != 0) {
+ /* Error during parsing, message has already been printed, now we have to bail out */
+ goto bail_out;
+ }
i = -1;
break;
}
" : Line %d, col %d of file %s\n%s\n"),
buf, lc->line_no, lc->col_no, lc->fname, lc->line);
}
+
+ lc->last_result = -1;
}