~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to imap/src/c-client/imap4r1.c

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2008-09-23 12:17:56 UTC
  • mfrom: (2.1.8 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080923121756-6u4x8bwq89qlzt32
Tags: 2.00+dfsg-2
Update to package description: note that Alpine is no longer in
alpha. (Closes: #499640)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *              Internet: MRC@CAC.Washington.EDU
22
22
 *
23
23
 * Date:        15 June 1988
24
 
 * Last Edited: 19 February 2008
 
24
 * Last Edited: 8 May 2008
25
25
 *
26
26
 * This original version of this file is
27
27
 * Copyright 1988 Stanford University
2394
2394
                                /* otherwise try to make into UID EXPUNGE */
2395
2395
    else if (mail_sequence (stream,sequence)) {
2396
2396
      unsigned long i,j;
2397
 
      char *s = LOCAL->tmp;
 
2397
      char *t = (char *) fs_get (IMAPTMPLEN);
 
2398
      char *s = t;
2398
2399
                                /* search through mailbox */
2399
 
      for (s = '\0',i = 1; i <= stream->nmsgs; ++i) 
 
2400
      for (*s = '\0', i = 1; i <= stream->nmsgs; ++i)
2400
2401
        if (mail_elt (stream,i)->sequence) {
2401
 
                                /* prepend with comma if not first time */
2402
 
        if (LOCAL->tmp[0]) *s++ = ',';
2403
 
        sprintf (s,"%lu",mail_uid (stream,j = i));
2404
 
        s += strlen (s);        /* point at end of string */
 
2402
          if (t[0]) *s++ = ','; /* prepend with comma if not first time */
 
2403
          sprintf (s,"%lu",mail_uid (stream,j = i));
 
2404
          s += strlen (s);      /* point at end of string */
2405
2405
                                /* search for possible end of range */
2406
 
        while ((i < stream->nmsgs) && mail_elt (stream,i+1)->sequence) i++;
2407
 
        if (i != j) {           /* output end of range */
2408
 
          sprintf (s,":%lu",mail_uid (stream,i));
2409
 
          s += strlen (s);      /* point at end of string */
2410
 
        }
2411
 
        if ((s - LOCAL->tmp) > (IMAPTMPLEN - 50)) {
2412
 
          mm_log ("Excessively complex sequence",ERROR);
2413
 
          return NIL;
2414
 
        }
2415
 
      }
 
2406
          while ((i < stream->nmsgs) && mail_elt (stream,i+1)->sequence) i++;
 
2407
          if (i != j) {         /* output end of range */
 
2408
            sprintf (s,":%lu",mail_uid (stream,i));
 
2409
            s += strlen (s);    /* point at end of string */
 
2410
          }
 
2411
          if ((s - t) > (IMAPTMPLEN - 50)) {
 
2412
            mm_log ("Excessively complex sequence",ERROR);
 
2413
            return NIL;
 
2414
          }
 
2415
        }
2416
2416
                                /* now do as UID EXPUNGE */
2417
 
      ret = imap_expunge (stream,s = cpystr (s),EX_UID);
2418
 
      fs_give ((void **) &s);
 
2417
      ret = imap_expunge (stream,t,EX_UID);
 
2418
      fs_give ((void **) &t);
2419
2419
    }
2420
2420
  }
2421
2421
                                /* ordinary EXPUNGE */