mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
config: log_contextual_errno(): sync with log_contextual()
... in terms of whether to print section/value separators
This commit is contained in:
parent
e41555fe0f
commit
1c9d98d57e
1 changed files with 12 additions and 3 deletions
15
config.c
15
config.c
|
|
@ -283,10 +283,19 @@ log_contextual_errno(struct context *ctx, const char *file, int lineno,
|
|||
char *formatted_msg = xvasprintf(fmt, va);
|
||||
va_end(va);
|
||||
|
||||
bool print_dot = ctx->key != NULL;
|
||||
bool print_colon = ctx->value != NULL;
|
||||
|
||||
if (!print_dot)
|
||||
ctx->key = "";
|
||||
|
||||
if (!print_colon)
|
||||
ctx->value = "";
|
||||
|
||||
log_and_notify_errno(
|
||||
ctx->conf, file, lineno, "%s:%d: [%s].%s: %s: %s",
|
||||
ctx->path, ctx->lineno, ctx->section, ctx->key, ctx->value,
|
||||
formatted_msg);
|
||||
ctx->conf, file, lineno, "%s:%d: [%s]%s%s%s%s: %s",
|
||||
ctx->path, ctx->lineno, ctx->section, print_dot ? "." : "",
|
||||
ctx->key, print_colon ? ": " : "", ctx->value, formatted_msg);
|
||||
|
||||
free(formatted_msg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue