author | Junio C Hamano <gitster@pobox.com> | |
Mon, 8 Feb 2010 23:09:19 +0000 (15:09 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 8 Feb 2010 23:09:19 +0000 (15:09 -0800) |
* jc/maint-imap-config-parse:
Fix parsing of imap.preformattedHTML and imap.sslverify
Fix parsing of imap.preformattedHTML and imap.sslverify
imap-send.c | patch | blob | history |
diff --git a/imap-send.c b/imap-send.c
index de8114bac010ef095cf9de17671566e248366dcb..ea769a960a213249ecf2e2dde645f1f5e98cd761 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;
}