2006-11-14 [paul] 2.6.0cvs47
authorColin Leroy <colin@colino.net>
Tue, 14 Nov 2006 15:09:11 +0000 (15:09 +0000)
committerColin Leroy <colin@colino.net>
Tue, 14 Nov 2006 15:09:11 +0000 (15:09 +0000)
* src/Makefile.am
Fix make DESTDIR=...
* src/mbox.c
Optimise speed
* src/plugins/pgpinline/pgpinline.c
Probably fix bug 1061

ChangeLog
PATCHSETS
configure.ac
src/Makefile.am
src/mbox.c
src/plugins/pgpinline/pgpinline.c

index bfcbe20b704b128ec292ca20172c18bc29dbf428..a39c654ecc115e08b626124421a764a4d57a0719 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-11-14 [paul]      2.6.0cvs47
+
+       * src/Makefile.am
+               Fix make DESTDIR=...
+       * src/mbox.c
+               Optimise speed
+       * src/plugins/pgpinline/pgpinline.c
+               Probably fix bug 1061
+
 2006-11-14 [paul]      2.6.0cvs46
 
        * po/Makevars
index 69c8ce094e92f72b1f89195a911742a00fdd8772..71aa038b7773680637e6fcd5e64fa7b52ec7bae8 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.329 -r 1.382.2.330 src/compose.c;  cvs diff -u -r 1.149.2.61 -r 1.149.2.62 src/inc.c;  cvs diff -u -r 1.94.2.109 -r 1.94.2.110 src/messageview.c;  cvs diff -u -r 1.101.2.32 -r 1.101.2.33 src/news.c;  cvs diff -u -r 1.56.2.45 -r 1.56.2.46 src/pop.c;  cvs diff -u -r 1.150.2.82 -r 1.150.2.83 src/procmsg.c;  cvs diff -u -r 1.3.2.22 -r 1.3.2.23 src/ssl_manager.c;  cvs diff -u -r 1.9.2.43 -r 1.9.2.44 src/gtk/gtkaspell.c;  cvs diff -u -r 1.1.2.36 -r 1.1.2.37 src/plugins/pgpcore/sgpgme.c;  ) > 2.6.0cvs44.patchset
 ( cvs diff -u -r 1.17.2.12 -r 1.17.2.13 po/ru.po;  ) > 2.6.0cvs45.patchset
 ( cvs diff -u -r 1.1.4.4 -r 1.1.4.5 po/Makevars;  cvs diff -u -r 1.155.2.47 -r 1.155.2.48 src/Makefile.am;  cvs diff -u -r 1.25.2.29 -r 1.25.2.30 src/stock_pixmap.c;  cvs diff -u -r 1.18.2.20 -r 1.18.2.21 src/stock_pixmap.h;  cvs diff -u -r 1.4.2.38 -r 1.4.2.39 src/gtk/about.c;  diff -u /dev/null src/pixmaps/active.xpm;  diff -u /dev/null src/pixmaps/inactive.xpm;  ) > 2.6.0cvs46.patchset
+( cvs diff -u -r 1.155.2.48 -r 1.155.2.49 src/Makefile.am;  cvs diff -u -r 1.28.2.30 -r 1.28.2.31 src/mbox.c;  cvs diff -u -r 1.1.2.23 -r 1.1.2.24 src/plugins/pgpinline/pgpinline.c;  ) > 2.6.0cvs47.patchset
index 1a593935a613e2296439b1bfb6f4836a1ce4adf7..1e68f5bd23d211c3a3bf54f76af212142c08877b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=46
+EXTRA_VERSION=47
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 904f8a34ce34678b336d07990bc569b8b01e7539..437a4e0809486c058eedc9fcc1aa275e7af0c9a9 100644 (file)
@@ -11,8 +11,8 @@ SUBDIRS = common gtk $(etpan_dir) . plugins
 
 bin_PROGRAMS = claws-mail
 install-exec-hook:
-       @rm -f $(bindir)/sylpheed-claws
-       @ln -s claws-mail $(bindir)/sylpheed-claws
+       @rm -f $(DESTDIR)$(bindir)/sylpheed-claws
+       @ln -s claws-mail $(DESTDIR)$(bindir)/sylpheed-claws
 
 claws_mail_SOURCES = \
        account.c \
index 973210417672e6c401040c2c32402aafe16ab82c..f7ecc42820e02efe940f2558519760e59981d1da 100644 (file)
 #  include "config.h"
 #endif
 
-#include "defs.h"
 
+#define _GNU_SOURCE
+#include <stdio.h>
+
+#include "defs.h"
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
 
 #define MSGBUFSIZE     8192
 
+#ifdef HAVE_FGETS_UNLOCKED
+#define SC_FGETS fgets_unlocked
+#define SC_FPUTS fputs_unlocked
+#define SC_FPUTC fputc_unlocked
+#else
+#define SC_FGETS fgets
+#define SC_FPUTS fputs
+#define SC_FPUTC fputc
+#endif
+
 #define FPUTS_TO_TMP_ABORT_IF_FAIL(s) \
 { \
        lines++; \
@@ -480,6 +493,10 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
                return -1;
        }
 
+#ifdef HAVE_FGETS_UNLOCKED
+       flockfile(mbox_fp);
+#endif
+
        statusbar_print_all(_("Exporting to mbox..."));
        for (cur = mlist; cur != NULL; cur = cur->next) {
                int len;
@@ -490,6 +507,9 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
                        continue;
                }
 
+#ifdef HAVE_FGETS_UNLOCKED
+               flockfile(msg_fp);
+#endif
                strncpy2(buf,
                         msginfo->from ? msginfo->from :
                         cur_account && cur_account->address ?
@@ -503,7 +523,7 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
                buf[0] = '\0';
                
                /* write email to mboxrc */
-               while (fgets(buf, sizeof(buf), msg_fp) != NULL) {
+               while (SC_FGETS(buf, sizeof(buf), msg_fp) != NULL) {
                        /* quote any From, >From, >>From, etc., according to mbox format specs */
                        int offset;
 
@@ -513,8 +533,8 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
                                offset++;
                        }
                        if (!strncmp(buf+offset, "From ", 5))
-                               fputc('>', mbox_fp);
-                       fputs(buf, mbox_fp);
+                               SC_FPUTC('>', mbox_fp);
+                       SC_FPUTS(buf, mbox_fp);
                }
 
                /* force last line to end w/ a newline */
@@ -522,12 +542,15 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
                if (len > 0) {
                        len--;
                        if ((buf[len] != '\n') && (buf[len] != '\r'))
-                               fputc('\n', mbox_fp);
+                               SC_FPUTC('\n', mbox_fp);
                }
 
                /* add a trailing empty line */
-               fputc('\n', mbox_fp);
+               SC_FPUTC('\n', mbox_fp);
 
+#ifdef HAVE_FGETS_UNLOCKED
+               funlockfile(msg_fp);
+#endif
                fclose(msg_fp);
                statusbar_progress_all(msgs++,total, 500);
                if (msgs%500 == 0)
@@ -536,6 +559,9 @@ gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
        statusbar_progress_all(0,0,0);
        statusbar_pop_all();
 
+#ifdef HAVE_FGETS_UNLOCKED
+       funlockfile(mbox_fp);
+#endif
        fclose(mbox_fp);
 
        return 0;
@@ -557,7 +583,9 @@ gint export_to_mbox(FolderItem *src, const gchar *mbox)
 
        mlist = folder_item_get_msg_list(src);
 
+       folder_item_update_freeze();
        ret = export_list_to_mbox(mlist, mbox);
+       folder_item_update_thaw();
 
        procmsg_msg_list_free(mlist);
 
index bfd8d027f0ae0a8bd54a45c21a65fe4ea228c7ce..d3ef4ed62d5f7439b3c82e34d563d144f93bf5b9 100644 (file)
@@ -222,7 +222,6 @@ static gint pgpinline_check_signature(MimeInfo *mimeinfo)
        PrivacyDataPGP *data = NULL;
        gchar *textdata = NULL, *tmp = NULL;
        gpgme_data_t plain = NULL, cipher = NULL;
-       gpgme_ctx_t ctx;
        gpgme_error_t err;
 
        g_return_val_if_fail(mimeinfo != NULL, 0);
@@ -263,24 +262,22 @@ static gint pgpinline_check_signature(MimeInfo *mimeinfo)
        textdata = g_strdup(tmp);
        g_free(tmp);
        
-       if ((err = gpgme_new(&ctx)) != GPG_ERR_NO_ERROR) {
+       if ((err = gpgme_new(&data->ctx)) != GPG_ERR_NO_ERROR) {
                debug_print(("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
                privacy_set_error(_("Couldn't initialize GPG context, %s"), gpgme_strerror(err));
                return 0;
        }
-       gpgme_set_textmode(ctx, 1);
-       gpgme_set_armor(ctx, 1);
+       gpgme_set_textmode(data->ctx, 1);
+       gpgme_set_armor(data->ctx, 1);
        
        gpgme_data_new_from_mem(&plain, textdata, (size_t)strlen(textdata), 1);
        gpgme_data_new(&cipher);
 
-       data->sigstatus = sgpgme_verify_signature(ctx, plain, NULL, cipher);
+       data->sigstatus = sgpgme_verify_signature(data->ctx, plain, NULL, cipher);
        
        gpgme_data_release(plain);
        gpgme_data_release(cipher);
        
-       gpgme_release(ctx);
-
        g_free(textdata);
        
        return 0;