Change so that source-file errors are reported correctly in control

mode, from Sergei Nizovtsev in GitHub issue 4626.
This commit is contained in:
nicm
2025-09-08 07:30:15 +00:00
parent 7cc15969ff
commit d73196750f
2 changed files with 7 additions and 3 deletions

8
cfg.c
View File

@@ -222,10 +222,14 @@ cfg_add_cause(const char *fmt, ...)
void
cfg_print_causes(struct cmdq_item *item)
{
u_int i;
struct client *c = cmdq_get_client(item);
u_int i;
for (i = 0; i < cfg_ncauses; i++) {
cmdq_print(item, "%s", cfg_causes[i]);
if (c != NULL && (c->flags & CLIENT_CONTROL))
control_write(c, "%%config-error %s", cfg_causes[i]);
else
cmdq_print(item, "%s", cfg_causes[i]);
free(cfg_causes[i]);
}