Skip to content

Commit 1efee7f

Browse files
mhaggergitster
authored andcommitted
imap-send.c: remove some unused fields from struct store
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e6de375 commit 1efee7f

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

imap-send.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ typedef void *SSL;
3636
struct store {
3737
/* currently open mailbox */
3838
const char *name; /* foreign! maybe preset? */
39-
char *path; /* own */
4039
int uidvalidity;
41-
unsigned char opts; /* maybe preset? */
42-
/* note that the following do _not_ reflect stats from msgs, but mailbox totals */
43-
int count; /* # of messages */
44-
int recent; /* # of recent messages - don't trust this beyond the initial read */
4540
};
4641

4742
static const char imap_send_usage[] = "git imap-send < <mbox>";
@@ -772,13 +767,20 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
772767
!strcmp("NO", arg) || !strcmp("BYE", arg)) {
773768
if ((resp = parse_response_code(ctx, NULL, cmd)) != RESP_OK)
774769
return resp;
775-
} else if (!strcmp("CAPABILITY", arg))
770+
} else if (!strcmp("CAPABILITY", arg)) {
776771
parse_capability(imap, cmd);
777-
else if ((arg1 = next_arg(&cmd))) {
778-
if (!strcmp("EXISTS", arg1))
779-
ctx->gen.count = atoi(arg);
780-
else if (!strcmp("RECENT", arg1))
781-
ctx->gen.recent = atoi(arg);
772+
} else if ((arg1 = next_arg(&cmd))) {
773+
; /*
774+
* Unhandled response-data with at least two words.
775+
* Ignore it.
776+
*
777+
* NEEDSWORK: Previously this case handled '<num> EXISTS'
778+
* and '<num> RECENT' but as a probably-unintended side
779+
* effect it ignores other unrecognized two-word
780+
* responses. imap-send doesn't ever try to read
781+
* messages or mailboxes these days, so consider
782+
* eliminating this case.
783+
*/
782784
} else {
783785
fprintf(stderr, "IMAP error: unable to parse untagged response\n");
784786
return RESP_BAD;
@@ -1254,7 +1256,6 @@ static int imap_store_msg(struct store *gctx, struct strbuf *msg)
12541256
imap->caps = imap->rcaps;
12551257
if (ret != DRV_OK)
12561258
return ret;
1257-
gctx->count++;
12581259

12591260
return DRV_OK;
12601261
}

0 commit comments

Comments
 (0)