~ubuntu-branches/ubuntu/breezy/evolution-data-server/breezy

« back to all changes in this revision

Viewing changes to camel/providers/local/camel-mbox-summary.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-10-10 11:30:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010113056-rb4vj4kbs8yxft85
Tags: 1.4.1-0ubuntu3
* debian/patches/camel-imap-store.c.patch:
  - Ubuntu 17465: apply patch from
  http://bugzilla.gnome.org/attachment.cgi?id=53234&action=view
  (additional NULL pointer check)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *  Authors: Michael Zucchi <notzed@ximian.com>
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or
8
 
 * modify it under the terms of version 2 of the GNU General Public
 
8
 * modify it under the terms of version 2 of the GNU Lesser General Public
9
9
 * License as published by the Free Software Foundation.
10
10
 *
11
11
 * This program is distributed in the hope that it will be useful,
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
14
 * General Public License for more details.
15
15
 *
16
 
 * You should have received a copy of the GNU General Public
 
16
 * You should have received a copy of the GNU Lesser General Public
17
17
 * License along with this program; if not, write to the
18
18
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
19
 * Boston, MA 02111-1307, USA.
107
107
 
108
108
        res = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->info_set_user_flag(mi, name, value);
109
109
        if (res)
110
 
                ((CamelLocalMessageInfo *)mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED|CAMEL_MESSAGE_FOLDER_XEVCHANGE;
 
110
                ((CamelLocalMessageInfo *)mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
111
111
 
112
112
        return res;
113
113
}
119
119
 
120
120
        res = ((CamelFolderSummaryClass *)camel_mbox_summary_parent)->info_set_user_tag(mi, name, value);
121
121
        if (res)
122
 
                ((CamelLocalMessageInfo *)mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED|CAMEL_MESSAGE_FOLDER_XEVCHANGE;
 
122
                ((CamelLocalMessageInfo *)mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
123
123
 
124
124
        return res;
125
125
}
669
669
        CamelMimeParser *mp = NULL;
670
670
        int i, count;
671
671
        CamelMboxMessageInfo *info = NULL;
672
 
        int fd = -1;
 
672
        int fd = -1, pfd;
673
673
        char *xevnew, *xevtmp;
674
674
        const char *xev;
675
675
        int len;
689
689
                return -1;
690
690
        }
691
691
 
 
692
        /* need to dup since mime parser closes its fd once it is finalised */
 
693
        pfd = dup(fd);
 
694
        if (pfd == -1) {
 
695
                camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
 
696
                                     _("Could not store folder: %s"),
 
697
                                     g_strerror(errno));
 
698
                close(fd);
 
699
                return -1;
 
700
        }
 
701
 
692
702
        mp = camel_mime_parser_new();
693
703
        camel_mime_parser_scan_from(mp, TRUE);
694
704
        camel_mime_parser_scan_pre_from(mp, TRUE);
695
 
        camel_mime_parser_init_with_fd(mp, fd);
 
705
        camel_mime_parser_init_with_fd(mp, pfd);
696
706
 
697
707
        count = camel_folder_summary_count(s);
698
708
        for (i = 0; i < count; i++) {
749
759
                xevtmp = camel_header_unfold(xevnew);
750
760
                /* the raw header contains a leading ' ', so (dis)count that too */
751
761
                if (strlen(xev)-1 != strlen(xevtmp)) {
752
 
                        printf ("strlen(xev)-1 = %d; strlen(xevtmp) = %d\n", strlen(xev)-1, strlen(xevtmp));
753
 
                        printf ("xev='%s'; xevtmp='%s'\n", xev, xevtmp);
754
762
                        g_free(xevnew);
755
763
                        g_free(xevtmp);
756
764
                        g_warning("Hmm, the xev headers shouldn't have changed size, but they did");