imap-send.c: imap_folder -> imap_server_conf.folder

Rename the imap_folder variable to folder and make it a member of struct imap_server_conf. Signed-off-by: Bernhard Reiter <ockham@raz.or.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bernhard Reiter committed Aug 19, 2014 at 23:27 UTC 3918057164a8060082b828c0ac1ce25ad6a86d38
1 file changed +5 -5
imap-send.c
+5 -5
@@ -69,6 +69,7 @@ struct imap_server_conf {
69 char *tunnel;
70 char *host;
71 int port;
72 + char *folder;
73 char *user;
74 char *pass;
75 int use_ssl;
@@ -82,6 +83,7 @@ static struct imap_server_conf server = {
83 NULL, /* tunnel */
84 NULL, /* host */
85 0, /* port */
86 + NULL, /* folder */
87 NULL, /* user */
88 NULL, /* pass */
89 0, /* use_ssl */
@@ -1323,8 +1325,6 @@ static int split_msg(struct strbuf *all_msgs, struct strbuf *msg, int *ofs)
1325 return 1;
1326 }
1327
1326 -static char *imap_folder;
1327 -
1328 static int git_imap_config(const char *key, const char *val, void *cb)
1329 {
1330 if (!skip_prefix(key, "imap.", &key))
@@ -1339,7 +1339,7 @@ static int git_imap_config(const char *key, const char *val, void *cb)
1339 return config_error_nonbool(key);
1340
1341 if (!strcmp("folder", key)) {
1342 - imap_folder = xstrdup(val);
1342 + server.folder = xstrdup(val);
1343 } else if (!strcmp("host", key)) {
1344 if (starts_with(val, "imap:"))
1345 val += 5;
@@ -1387,7 +1387,7 @@ int main(int argc, char **argv)
1387 if (!server.port)
1388 server.port = server.use_ssl ? 993 : 143;
1389
1390 - if (!imap_folder) {
1390 + if (!server.folder) {
1391 fprintf(stderr, "no imap store specified\n");
1392 return 1;
1393 }
@@ -1424,7 +1424,7 @@ int main(int argc, char **argv)
1424 }
1425
1426 fprintf(stderr, "sending %d message%s\n", total, (total != 1) ? "s" : "");
1427 - ctx->name = imap_folder;
1427 + ctx->name = server.folder;
1428 while (1) {
1429 unsigned percent = n * 100 / total;
1430