Skip to content

Commit

Permalink
builtin-log.c: guard config parser from value=NULL
Browse files Browse the repository at this point in the history
format.suffix expects a string value.  format.numbered is bool plus "auto"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 11, 2008
1 parent 3c17c34 commit 90f5c18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions builtin-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,19 +432,18 @@ static int git_format_config(const char *var, const char *value)
}
if (!strcmp(var, "format.suffix")) {
if (!value)
die("format.suffix without value");
return config_error_nonbool(var);
fmt_patch_suffix = xstrdup(value);
return 0;
}
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
return 0;
}
if (!strcmp(var, "format.numbered")) {
if (!strcasecmp(value, "auto")) {
if (value && !strcasecmp(value, "auto")) {
auto_number = 1;
return 0;
}

numbered = git_config_bool(var, value);
return 0;
}
Expand Down

0 comments on commit 90f5c18

Please sign in to comment.