Skip to content

Commit 42dd38d

Browse files
committed
config: lowercase error messages
Update the configuration parsing error messages to be lower-cased for consistency with the rest of the library.
1 parent d97afb9 commit 42dd38d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/config_parse.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
7575

7676
first_quote = strchr(line, '"');
7777
if (first_quote == NULL) {
78-
set_parse_error(reader, 0, "Missing quotation marks in section header");
78+
set_parse_error(reader, 0, "missing quotation marks in section header");
7979
goto end_error;
8080
}
8181

8282
last_quote = strrchr(line, '"');
8383
quoted_len = last_quote - first_quote;
8484

8585
if (quoted_len == 0) {
86-
set_parse_error(reader, 0, "Missing closing quotation mark in section header");
86+
set_parse_error(reader, 0, "missing closing quotation mark in section header");
8787
goto end_error;
8888
}
8989

@@ -107,7 +107,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
107107

108108
switch (c) {
109109
case 0:
110-
set_parse_error(reader, 0, "Unexpected end-of-line in section header");
110+
set_parse_error(reader, 0, "unexpected end-of-line in section header");
111111
goto end_error;
112112

113113
case '"':
@@ -117,7 +117,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
117117
c = line[++rpos];
118118

119119
if (c == 0) {
120-
set_parse_error(reader, rpos, "Unexpected end-of-line in section header");
120+
set_parse_error(reader, rpos, "unexpected end-of-line in section header");
121121
goto end_error;
122122
}
123123

@@ -134,7 +134,7 @@ static int parse_section_header_ext(git_config_parser *reader, const char *line,
134134
goto end_error;
135135

136136
if (line[rpos] != '"' || line[rpos + 1] != ']') {
137-
set_parse_error(reader, rpos, "Unexpected text after closing quotes");
137+
set_parse_error(reader, rpos, "unexpected text after closing quotes");
138138
git_buf_dispose(&buf);
139139
return -1;
140140
}
@@ -165,7 +165,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
165165
name_end = strrchr(line, ']');
166166
if (name_end == NULL) {
167167
git__free(line);
168-
set_parse_error(reader, 0, "Missing ']' in section header");
168+
set_parse_error(reader, 0, "missing ']' in section header");
169169
return -1;
170170
}
171171

@@ -192,7 +192,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
192192
}
193193

194194
if (!config_keychar(c) && c != '.') {
195-
set_parse_error(reader, pos, "Unexpected character in header");
195+
set_parse_error(reader, pos, "unexpected character in header");
196196
goto fail_parse;
197197
}
198198

@@ -201,7 +201,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
201201
} while ((c = line[pos++]) != ']');
202202

203203
if (line[pos - 1] != ']') {
204-
set_parse_error(reader, pos, "Unexpected end of file");
204+
set_parse_error(reader, pos, "unexpected end of file");
205205
goto fail_parse;
206206
}
207207

@@ -386,7 +386,7 @@ static int parse_name(
386386
name_end++;
387387

388388
if (line == name_end) {
389-
set_parse_error(reader, 0, "Invalid configuration key");
389+
set_parse_error(reader, 0, "invalid configuration key");
390390
return -1;
391391
}
392392

@@ -398,7 +398,7 @@ static int parse_name(
398398
if (*value_start == '=') {
399399
*value = value_start + 1;
400400
} else if (*value_start) {
401-
set_parse_error(reader, 0, "Invalid configuration key");
401+
set_parse_error(reader, 0, "invalid configuration key");
402402
return -1;
403403
}
404404

0 commit comments

Comments
 (0)