Commit 42dd38dd by Edward Thomson

config: lowercase error messages

Update the configuration parsing error messages to be lower-cased for
consistency with the rest of the library.
parent d97afb93
...@@ -75,7 +75,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line, ...@@ -75,7 +75,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
first_quote = strchr(line, '"'); first_quote = strchr(line, '"');
if (first_quote == NULL) { if (first_quote == NULL) {
set_parse_error(reader, 0, "Missing quotation marks in section header"); set_parse_error(reader, 0, "missing quotation marks in section header");
goto end_error; goto end_error;
} }
...@@ -83,7 +83,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line, ...@@ -83,7 +83,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
quoted_len = last_quote - first_quote; quoted_len = last_quote - first_quote;
if (quoted_len == 0) { if (quoted_len == 0) {
set_parse_error(reader, 0, "Missing closing quotation mark in section header"); set_parse_error(reader, 0, "missing closing quotation mark in section header");
goto end_error; goto end_error;
} }
...@@ -107,7 +107,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line, ...@@ -107,7 +107,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
switch (c) { switch (c) {
case 0: case 0:
set_parse_error(reader, 0, "Unexpected end-of-line in section header"); set_parse_error(reader, 0, "unexpected end-of-line in section header");
goto end_error; goto end_error;
case '"': case '"':
...@@ -117,7 +117,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line, ...@@ -117,7 +117,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
c = line[++rpos]; c = line[++rpos];
if (c == 0) { if (c == 0) {
set_parse_error(reader, rpos, "Unexpected end-of-line in section header"); set_parse_error(reader, rpos, "unexpected end-of-line in section header");
goto end_error; goto end_error;
} }
...@@ -134,7 +134,7 @@ end_parse: ...@@ -134,7 +134,7 @@ end_parse:
goto end_error; goto end_error;
if (line[rpos] != '"' || line[rpos + 1] != ']') { if (line[rpos] != '"' || line[rpos + 1] != ']') {
set_parse_error(reader, rpos, "Unexpected text after closing quotes"); set_parse_error(reader, rpos, "unexpected text after closing quotes");
git_buf_dispose(&buf); git_buf_dispose(&buf);
return -1; return -1;
} }
...@@ -165,7 +165,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out) ...@@ -165,7 +165,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
name_end = strrchr(line, ']'); name_end = strrchr(line, ']');
if (name_end == NULL) { if (name_end == NULL) {
git__free(line); git__free(line);
set_parse_error(reader, 0, "Missing ']' in section header"); set_parse_error(reader, 0, "missing ']' in section header");
return -1; return -1;
} }
...@@ -192,7 +192,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out) ...@@ -192,7 +192,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
} }
if (!config_keychar(c) && c != '.') { if (!config_keychar(c) && c != '.') {
set_parse_error(reader, pos, "Unexpected character in header"); set_parse_error(reader, pos, "unexpected character in header");
goto fail_parse; goto fail_parse;
} }
...@@ -201,7 +201,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out) ...@@ -201,7 +201,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
} while ((c = line[pos++]) != ']'); } while ((c = line[pos++]) != ']');
if (line[pos - 1] != ']') { if (line[pos - 1] != ']') {
set_parse_error(reader, pos, "Unexpected end of file"); set_parse_error(reader, pos, "unexpected end of file");
goto fail_parse; goto fail_parse;
} }
...@@ -386,7 +386,7 @@ static int parse_name( ...@@ -386,7 +386,7 @@ static int parse_name(
name_end++; name_end++;
if (line == name_end) { if (line == name_end) {
set_parse_error(reader, 0, "Invalid configuration key"); set_parse_error(reader, 0, "invalid configuration key");
return -1; return -1;
} }
...@@ -398,7 +398,7 @@ static int parse_name( ...@@ -398,7 +398,7 @@ static int parse_name(
if (*value_start == '=') { if (*value_start == '=') {
*value = value_start + 1; *value = value_start + 1;
} else if (*value_start) { } else if (*value_start) {
set_parse_error(reader, 0, "Invalid configuration key"); set_parse_error(reader, 0, "invalid configuration key");
return -1; return -1;
} }
......
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