aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/config.c b/config.c
index 7e5dbca4bd..92c752ed9f 100644
--- a/config.c
+++ b/config.c
@@ -1565,13 +1565,13 @@ static int git_default_core_config(const char *var, const char *value,
return config_error_nonbool(var);
else if (!strcasecmp(value, "auto"))
auto_comment_line_char = 1;
- else if (value[0] && !value[1]) {
- if (value[0] == '\n')
- return error(_("core.commentChar cannot be newline"));
- comment_line_str = xstrfmt("%c", value[0]);
+ else if (value[0]) {
+ if (strchr(value, '\n'))
+ return error(_("core.commentChar cannot contain newline"));
+ comment_line_str = xstrdup(value);
auto_comment_line_char = 0;
} else
- return error(_("core.commentChar should only be one ASCII character"));
+ return error(_("core.commentChar must have at least one character"));
return 0;
}