Commit b83bd037 by Edward Thomson

config: don't write invalid column

When we don't specify a particular column, don't write it in the error
message.  (column "0" is unhelpful.)
parent 42dd38dd
......@@ -17,8 +17,15 @@ const char *git_config_escaped = "\n\t\b\"\\";
static void set_parse_error(git_config_parser *reader, int col, const char *error_str)
{
const char *file = reader->file ? reader->file->path : "in-memory";
git_error_set(GIT_ERROR_CONFIG, "failed to parse config file: %s (in %s:%"PRIuZ", column %d)",
error_str, file, reader->ctx.line_num, col);
if (col)
git_error_set(GIT_ERROR_CONFIG,
"failed to parse config file: %s (in %s:%"PRIuZ", column %d)",
error_str, file, reader->ctx.line_num, col);
else
git_error_set(GIT_ERROR_CONFIG,
"failed to parse config file: %s (in %s:%"PRIuZ")",
error_str, file, reader->ctx.line_num);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment