git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] imap-send.c: imap_folder -> imap_server_conf.folder

From
Bernhard Reiter <ockham@raz.or.at>
Date
Aug 19, 2014, 21:27 UTC
Message-ID
<53F3C12F.3020606@raz.or.at>

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>
---
As discussed in
http://www.mail-archive.com/git@vger.kernel.org/msg57019.html
Bernhard
 imap-send.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/imap-send.c b/imap-send.c
index fb01a9c..05a02b5 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -69,6 +69,7 @@ struct imap_server_conf {
 	char *tunnel;
 	char *host;
 	int port;
+	char *folder;
 	char *user;
 	char *pass;
 	int use_ssl;
@@ -82,6 +83,7 @@ static struct imap_server_conf server = {
 	NULL,	/* tunnel */
 	NULL,	/* host */
 	0,	/* port */
+	NULL,	/* folder */
 	NULL,	/* user */
 	NULL,	/* pass */
 	0,   	/* use_ssl */
@@ -1323,8 +1325,6 @@ static int split_msg(struct strbuf *all_msgs,
struct strbuf *msg, int *ofs)
 	return 1;
 }
 -static char *imap_folder;
-
 static int git_imap_config(const char *key, const char *val, void *cb)
 {
 	if (!skip_prefix(key, "imap.", &key))
@@ -1339,7 +1339,7 @@ static int git_imap_config(const char *key, const
char *val, void *cb)
 		return config_error_nonbool(key);
  	if (!strcmp("folder", key)) {
-		imap_folder = xstrdup(val);
+		server.folder = xstrdup(val);
 	} else if (!strcmp("host", key)) {
 		if (starts_with(val, "imap:"))
 			val += 5;
@@ -1387,7 +1387,7 @@ int main(int argc, char **argv)
 	if (!server.port)
 		server.port = server.use_ssl ? 993 : 143;
 -	if (!imap_folder) {
+	if (!server.folder) {
 		fprintf(stderr, "no imap store specified\n");
 		return 1;
 	}
@@ -1424,7 +1424,7 @@ int main(int argc, char **argv)
 	}
  	fprintf(stderr, "sending %d message%s\n", total, (total != 1) ? "s" :
"");
-	ctx->name = imap_folder;
+	ctx->name = server.folder;
 	while (1) {
 		unsigned percent = n * 100 / total;
 -- 2.1.0.3.g63c96dd
Next: Junio C Hamano
Message 1 of 2 in “imap-send.c: imap_folder -> imap_server_conf.folder”
  1. imap-send.c: imap_folder -> imap_server_conf.folderBernhard Reiter, Aug 19, 2014
  2. Junio C HamanoAug 20, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.