Re: [PATCH v2 07/14] config: provide kvi with config files
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 7 quoted lines
> @@ -963,7 +965,8 @@ static int get_value(struct config_source *cs, config_fn_t fn, void *data,
> * accurate line number in error messages.
> */
> cs->linenr--;
> - ret = fn(name->buf, value, NULL, data);
> + kvi->linenr = cs->linenr;
> + ret = fn(name->buf, value, kvi, data);
Forgot to mention in my other email...it's a pity that we have to bump
the kvi->linenr like this because the original kvi generated from the
cs is now out-to-date w.r.t. the cs in terms of line number (you can
see in the context how the cs linenr is also updated), so there are now
2 sources of truth with regards to the line number. I can't think of a
better way to do this, though.