{"thread":{"id":"14304","subject":"[PATCH] Fix \"config_error_nonbool\" used with value instead of key","startedAt":"2008-07-06T04:10:04Z","lastAt":"2008-07-06T04:10:04Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82332","messageId":"20080706061004.22f6c91c.chriscool@tuxfamily.org","threadId":"14304","inReplyTo":null,"subject":"[PATCH] Fix \"config_error_nonbool\" used with value instead of key","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-07-06T04:10:04Z","receivedAt":"2008-07-06T04:10:04Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"The function \"config_error_nonbool\", that is defined in \"config.c\",\nis used to report an error when a config key in the config file\nshould have a corresponding value but it hasn't.\n\nSo the parameter to this function should be the key and not the\nvalue, because the value is undefined. And it could crash if the\nvalue is used.\n\nThis patches fixes two occurences where the value was passed\ninstead of the key.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin-tag.c |    2 +-\n wt-status.c   |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-tag.c b/builtin-tag.c\nindex e675206..3c97c69 100644\n--- a/builtin-tag.c\n+++ b/builtin-tag.c\n@@ -260,7 +260,7 @@ static int git_tag_config(const char *var, const char *value, void *cb)\n {\n \tif (!strcmp(var, \"user.signingkey\")) {\n \t\tif (!value)\n-\t\t\treturn config_error_nonbool(value);\n+\t\t\treturn config_error_nonbool(var);\n \t\tset_signingkey(value);\n \t\treturn 0;\n \t}\ndiff --git a/wt-status.c b/wt-status.c\nindex 28c9e63..e7d42d0 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -399,7 +399,7 @@ int git_status_config(const char *k, const char *v, void *cb)\n \t}\n \tif (!strcmp(k, \"status.showuntrackedfiles\")) {\n \t\tif (!v)\n-\t\t\treturn config_error_nonbool(v);\n+\t\t\treturn config_error_nonbool(k);\n \t\telse if (!strcmp(v, \"no\"))\n \t\t\tshow_untracked_files = SHOW_NO_UNTRACKED_FILES;\n \t\telse if (!strcmp(v, \"normal\"))\n-- \n1.5.6.1.205.gc094f\n"}]}