Skip to content

Commit 15f4ad1

Browse files
mhaggergitster
authored andcommitted
imap-send.c: remove struct imap argument to parse_imap_list_l()
It was always set to NULL. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 81b3894 commit 15f4ad1

1 file changed

Lines changed: 3 additions & 36 deletions

File tree

imap-send.c

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,10 @@ static void free_list(struct imap_list *list)
578578
}
579579
}
580580

581-
static int parse_imap_list_l(struct imap *imap, char **sp, struct imap_list **curp, int level)
581+
static int parse_imap_list_l(char **sp, struct imap_list **curp, int level)
582582
{
583583
struct imap_list *cur;
584584
char *s = *sp, *p;
585-
int n, bytes;
586585

587586
for (;;) {
588587
while (isspace((unsigned char)*s))
@@ -598,39 +597,7 @@ static int parse_imap_list_l(struct imap *imap, char **sp, struct imap_list **cu
598597
/* sublist */
599598
s++;
600599
cur->val = LIST;
601-
if (parse_imap_list_l(imap, &s, &cur->child, level + 1))
602-
goto bail;
603-
} else if (imap && *s == '{') {
604-
/* literal */
605-
bytes = cur->len = strtol(s + 1, &s, 10);
606-
if (*s != '}')
607-
goto bail;
608-
609-
s = cur->val = xmalloc(cur->len);
610-
611-
/* dump whats left over in the input buffer */
612-
n = imap->buf.bytes - imap->buf.offset;
613-
614-
if (n > bytes)
615-
/* the entire message fit in the buffer */
616-
n = bytes;
617-
618-
memcpy(s, imap->buf.buf + imap->buf.offset, n);
619-
s += n;
620-
bytes -= n;
621-
622-
/* mark that we used part of the buffer */
623-
imap->buf.offset += n;
624-
625-
/* now read the rest of the message */
626-
while (bytes > 0) {
627-
if ((n = socket_read(&imap->buf.sock, s, bytes)) <= 0)
628-
goto bail;
629-
s += n;
630-
bytes -= n;
631-
}
632-
633-
if (buffer_gets(&imap->buf, &s))
600+
if (parse_imap_list_l(&s, &cur->child, level + 1))
634601
goto bail;
635602
} else if (*s == '"') {
636603
/* quoted string */
@@ -673,7 +640,7 @@ static struct imap_list *parse_list(char **sp)
673640
{
674641
struct imap_list *head;
675642

676-
if (!parse_imap_list_l(NULL, sp, &head, 0))
643+
if (!parse_imap_list_l(sp, &head, 0))
677644
return head;
678645
free_list(head);
679646
return NULL;

0 commit comments

Comments
 (0)