return git_config_string(&editor_program, var, value);
if (!strcmp(var, "core.commentchar")) {
- const char *comment;
- int ret = git_config_string(&comment, var, value);
- if (ret)
- return ret;
- else if (!strcasecmp(comment, "auto"))
+ if (!value)
+ return config_error_nonbool(var);
- else
++ else if (!strcasecmp(value, "auto"))
+ auto_comment_line_char = 1;
- else if (comment[0] && !comment[1]) {
- comment_line_char = comment[0];
++ else if (value[0] && !value[1]) {
+ comment_line_char = value[0];
+ auto_comment_line_char = 0;
+ } else
+ return error("core.commentChar should only be one character");
return 0;
}