summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c64d84f)
raw | patch | inline | side by side (parent: c64d84f)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 6 Feb 2010 19:26:35 +0000 (11:26 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 8 Feb 2010 23:08:31 +0000 (15:08 -0800) |
These two variables are boolean and can lack "= value" in the
configuration file. Do not reject such input early in the
parser callback function.
Also the key are downcased before being given to the callback,
so we should run strcmp() with keyword spelled in all-lowercase.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
configuration file. Do not reject such input early in the
parser callback function.
Also the key are downcased before being given to the callback,
so we should run strcmp() with keyword spelled in all-lowercase.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c | patch | blob | history |
diff --git a/imap-send.c b/imap-send.c
index cb518eb613fdce7482a243ad9075df64ab1a4321..77acd68506b4362b4acda9dc0c4217840b06b3b5 100644 (file)
--- a/imap-send.c
+++ b/imap-send.c
if (strncmp(key, imap_key, sizeof imap_key - 1))
return 0;
- if (!val)
- return config_error_nonbool(key);
-
key += sizeof imap_key - 1;
+ /* check booleans first, and barf on others */
+ if (!strcmp("sslverify", key))
+ server.ssl_verify = git_config_bool(key, val);
+ else if (!strcmp("preformattedhtml", key))
+ server.use_html = git_config_bool(key, val);
+ else if (!val)
+ return config_error_nonbool(key);
+
if (!strcmp("folder", key)) {
imap_folder = xstrdup(val);
} else if (!strcmp("host", key)) {
server.port = git_config_int(key, val);
else if (!strcmp("tunnel", key))
server.tunnel = xstrdup(val);
- else if (!strcmp("sslverify", key))
- server.ssl_verify = git_config_bool(key, val);
- else if (!strcmp("preformattedHTML", key))
- server.use_html = git_config_bool(key, val);
return 0;
}