@matheusbsbs / matheus-bagliano / commits / 90f5c1864c
Fork 0

builtin-log.c: guard config parser from value=NULL

format.suffix expects a string value. format.numbered is bool plus "auto" Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Feb 11, 2008 at 13:09 UTC 90f5c1864caf40ac2a0fef6bc771eab3ecc561b6
1 file changed +2 -3
builtin-log.c
+2 -3
@@ -432,7 +432,7 @@ static int git_format_config(const char *var, const char *value)
432 }
433 if (!strcmp(var, "format.suffix")) {
434 if (!value)
435 - die("format.suffix without value");
435 + return config_error_nonbool(var);
436 fmt_patch_suffix = xstrdup(value);
437 return 0;
438 }
@@ -440,11 +440,10 @@ static int git_format_config(const char *var, const char *value)
440 return 0;
441 }
442 if (!strcmp(var, "format.numbered")) {
443 - if (!strcasecmp(value, "auto")) {
443 + if (value && !strcasecmp(value, "auto")) {
444 auto_number = 1;
445 return 0;
446 }
447 -
447 numbered = git_config_bool(var, value);
448 return 0;
449 }