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>
Michael Haggerty committed
Jan 15, 2013 at 09:06 UTC
15f4ad19d686f2b5cd6908b3dbad6d250518b177
1 file changed
+3
-36
imap-send.c
+3
-36
@@ -578,11 +578,10 @@ static void free_list(struct imap_list *list)
578
}
579
}
580
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)
582
{
583
struct imap_list *cur;
584
char *s = *sp, *p;
585
- int n, bytes;
585
586
for (;;) {
587
while (isspace((unsigned char)*s))
@@ -598,39 +597,7 @@ static int parse_imap_list_l(struct imap *imap, char **sp, struct imap_list **cu
597
/* sublist */
598
s++;
599
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))
601
goto bail;
602
} else if (*s == '"') {
603
/* quoted string */
@@ -673,7 +640,7 @@ static struct imap_list *parse_list(char **sp)
640
{
641
struct imap_list *head;
642
676
- if (!parse_imap_list_l(NULL, sp, &head, 0))
643
+ if (!parse_imap_list_l(sp, &head, 0))
644
return head;
645
free_list(head);
646
return NULL;