[Gpg4win-commits] r1080 - in trunk: . patches/claws-mail-3.7.0
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sat Jan 17 17:42:57 CET 2009
Author: colinleroy
Date: 2009-01-17 17:42:57 +0100 (Sat, 17 Jan 2009)
New Revision: 1080
Added:
trunk/patches/claws-mail-3.7.0/06-bug_1825.patch
Modified:
trunk/ChangeLog
Log:
2009-01-17 Colin Leroy <colin at colino.net>
* patches/claws-mail-3.7.0/06-bug_1825.patch
Fix opening IMAP mails in non-ascii folders.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-01-16 17:08:54 UTC (rev 1079)
+++ trunk/ChangeLog 2009-01-17 16:42:57 UTC (rev 1080)
@@ -1,3 +1,8 @@
+2009-01-17 Colin Leroy <colin at colino.net>
+
+ * patches/claws-mail-3.7.0/06-bug_1825.patch
+ Fix opening IMAP mails in non-ascii folders.
+
2009-01-16 Werner Koch <wk at g10code.com>
* packages/packages.current: Update gpgol.
Added: trunk/patches/claws-mail-3.7.0/06-bug_1825.patch
===================================================================
--- trunk/patches/claws-mail-3.7.0/06-bug_1825.patch 2009-01-16 17:08:54 UTC (rev 1079)
+++ trunk/patches/claws-mail-3.7.0/06-bug_1825.patch 2009-01-17 16:42:57 UTC (rev 1080)
@@ -0,0 +1,381 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+Index: src/main.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/main.c,v
+retrieving revision 1.115.2.218
+retrieving revision 1.115.2.219
+diff -u -p -u -r1.115.2.218 -r1.115.2.219
+--- src/main.c 9 Jan 2009 18:51:00 -0000 1.115.2.218
++++ src/main.c 17 Jan 2009 16:24:30 -0000 1.115.2.219
+@@ -2493,7 +2493,7 @@ static void install_memory_sighandler()
+ struct sigaction act;
+ int flags;
+
+- mem_notify_fd = open("/dev/mem_notify", O_RDONLY|O_NONBLOCK);
++ mem_notify_fd = g_open("/dev/mem_notify", O_RDONLY|O_NONBLOCK);
+ if (mem_notify_fd == -1) {
+ debug_print("/dev/mem_notify not available (%s)\n",
+ strerror(errno));
+Index: src/mbox.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/mbox.c,v
+retrieving revision 1.28.2.44
+retrieving revision 1.28.2.45
+diff -u -p -u -r1.28.2.44 -r1.28.2.45
+--- src/mbox.c 9 Jan 2009 17:46:56 -0000 1.28.2.44
++++ src/mbox.c 17 Jan 2009 16:24:30 -0000 1.28.2.45
+@@ -358,9 +358,9 @@ gint lock_mbox(const gchar *base, LockTy
+ #endif
+
+ #if HAVE_FLOCK
+- if ((lockfd = open(base, O_RDWR)) < 0) {
++ if ((lockfd = g_open(base, O_RDWR)) < 0) {
+ #else
+- if ((lockfd = open(base, O_RDWR)) < 0) {
++ if ((lockfd = g_open(base, O_RDWR)) < 0) {
+ #endif
+ FILE_OP_ERROR(base, "open");
+ return -1;
+Index: src/common/md5.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/common/md5.c,v
+retrieving revision 1.2.2.6
+retrieving revision 1.2.2.7
+diff -u -p -u -r1.2.2.6 -r1.2.2.7
+--- src/common/md5.c 11 Nov 2008 12:48:43 -0000 1.2.2.6
++++ src/common/md5.c 17 Jan 2009 16:24:30 -0000 1.2.2.7
+@@ -355,7 +355,7 @@ md5_hex_digest_file(char *hexdigest, con
+ char *lastp = buf; /* point to the start of the buffer */
+ size_t total = 0; /* total length read */
+ int num_alloc = 1; /* number of blocks allocated */
+- int fd = open(file, O_RDONLY);
++ int fd = g_open(file, O_RDONLY);
+
+ if (fd == -1) {
+ FILE_OP_ERROR(file, "open");
+Index: src/common/ssl_certificate.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/common/ssl_certificate.c,v
+retrieving revision 1.4.2.35
+retrieving revision 1.4.2.36
+diff -u -p -u -r1.4.2.35 -r1.4.2.36
+--- src/common/ssl_certificate.c 9 Jan 2009 17:47:12 -0000 1.4.2.35
++++ src/common/ssl_certificate.c 17 Jan 2009 16:24:31 -0000 1.4.2.36
+@@ -537,7 +537,7 @@ static guint check_cert(gnutls_x509_crt
+ FILE *fp;
+
+ if (claws_ssl_get_cert_file())
+- fp = fopen(claws_ssl_get_cert_file(), "r");
++ fp = g_fopen(claws_ssl_get_cert_file(), "r");
+ else
+ return (guint)-1;
+
+Index: src/common/tags.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/common/Attic/tags.c,v
+retrieving revision 1.1.2.9
+retrieving revision 1.1.2.10
+diff -u -p -u -r1.1.2.9 -r1.1.2.10
+--- src/common/tags.c 9 Jan 2009 17:47:12 -0000 1.1.2.9
++++ src/common/tags.c 17 Jan 2009 16:24:31 -0000 1.1.2.10
+@@ -50,7 +50,7 @@ void tags_read_tags(void)
+ TAGS_RC, NULL);
+ gchar tmp[255];
+ gint id;
+- FILE *fp = fopen(file, "rb");
++ FILE *fp = g_fopen(file, "rb");
+
+ g_free(file);
+
+@@ -122,10 +122,10 @@ void tags_write_tags(void)
+ TAGS_RC, NULL);
+ TagWriteData data;
+
+- FILE *fp = fopen(file, "wb");
++ FILE *fp = g_fopen(file, "wb");
+
+ if (!fp) {
+- FILE_OP_ERROR(file, "fopen");
++ FILE_OP_ERROR(file, "g_fopen");
+ g_free(file);
+ g_free(file_new);
+ return;
+Index: src/common/utils.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/common/utils.c,v
+retrieving revision 1.36.2.163
+retrieving revision 1.36.2.164
+diff -u -p -u -r1.36.2.163 -r1.36.2.164
+--- src/common/utils.c 9 Jan 2009 18:55:52 -0000 1.36.2.163
++++ src/common/utils.c 17 Jan 2009 16:24:31 -0000 1.36.2.164
+@@ -196,6 +196,17 @@ FILE* g_fopen(const gchar *filename, con
+ return fopen(filename, mode);
+ #endif
+ }
++int g_open(const gchar *filename, int flags, int mode)
++{
++#ifdef G_OS_WIN32
++ char *name = g_win32_locale_filename_from_utf8(filename);
++ int fd = open(name, flags, mode);
++ g_free(name);
++ return fp;
++#else
++ return open(filename, flags, mode);
++#endif
++}
+ #endif /* GLIB_CHECK_VERSION && G_OS_UNIX */
+
+
+@@ -207,7 +218,7 @@ gint mkstemp_name(gchar *template, gchar
+ int tmpfd;
+
+ *name_used = g_strdup_printf("%s.%ld",_mktemp(template),count++);
+- tmpfd = open (*name_used, (O_CREAT | O_RDWR | O_BINARY),
++ tmpfd = g_open (*name_used, (O_CREAT | O_RDWR | O_BINARY),
+ (S_IRUSR | S_IWUSR));
+
+ tempfiles=g_slist_append(tempfiles, g_strdup(*name_used));
+@@ -469,11 +480,11 @@ gint file_strip_crs(const gchar *file)
+ if (file == NULL)
+ goto freeout;
+
+- fp = fopen(file, "rb");
++ fp = g_fopen(file, "rb");
+ if (!fp)
+ goto freeout;
+
+- outfp = fopen(out, "wb");
++ outfp = g_fopen(out, "wb");
+ if (!outfp) {
+ fclose(fp);
+ goto freeout;
+@@ -2098,7 +2109,7 @@ off_t get_file_size_as_crlf(const gchar
+ gchar buf[BUFFSIZE];
+
+ if ((fp = g_fopen(file, "rb")) == NULL) {
+- FILE_OP_ERROR(file, "fopen");
++ FILE_OP_ERROR(file, "g_fopen");
+ return -1;
+ }
+
+@@ -2489,12 +2500,12 @@ gint append_file(const gchar *src, const
+ gboolean err = FALSE;
+
+ if ((src_fp = g_fopen(src, "rb")) == NULL) {
+- FILE_OP_ERROR(src, "fopen");
++ FILE_OP_ERROR(src, "g_fopen");
+ return -1;
+ }
+
+ if ((dest_fp = g_fopen(dest, "ab")) == NULL) {
+- FILE_OP_ERROR(dest, "fopen");
++ FILE_OP_ERROR(dest, "g_fopen");
+ fclose(src_fp);
+ return -1;
+ }
+@@ -2543,7 +2554,7 @@ gint copy_file(const gchar *src, const g
+ gboolean err = FALSE;
+
+ if ((src_fp = g_fopen(src, "rb")) == NULL) {
+- FILE_OP_ERROR(src, "fopen");
++ FILE_OP_ERROR(src, "g_fopen");
+ return -1;
+ }
+ if (is_file_exist(dest)) {
+@@ -2557,7 +2568,7 @@ gint copy_file(const gchar *src, const g
+ }
+
+ if ((dest_fp = g_fopen(dest, "wb")) == NULL) {
+- FILE_OP_ERROR(dest, "fopen");
++ FILE_OP_ERROR(dest, "g_fopen");
+ fclose(src_fp);
+ if (dest_bak) {
+ if (rename_force(dest_bak, dest) < 0)
+@@ -2678,7 +2689,7 @@ gint copy_file_part(FILE *fp, off_t offs
+ gboolean err = FALSE;
+
+ if ((dest_fp = g_fopen(dest, "wb")) == NULL) {
+- FILE_OP_ERROR(dest, "fopen");
++ FILE_OP_ERROR(dest, "g_fopen");
+ return -1;
+ }
+
+@@ -2749,12 +2760,12 @@ gint canonicalize_file(const gchar *src,
+ gboolean last_linebreak = FALSE;
+
+ if ((src_fp = g_fopen(src, "rb")) == NULL) {
+- FILE_OP_ERROR(src, "fopen");
++ FILE_OP_ERROR(src, "g_fopen");
+ return -1;
+ }
+
+ if ((dest_fp = g_fopen(dest, "wb")) == NULL) {
+- FILE_OP_ERROR(dest, "fopen");
++ FILE_OP_ERROR(dest, "g_fopen");
+ fclose(src_fp);
+ return -1;
+ }
+@@ -3056,7 +3067,7 @@ gint str_write_to_file(const gchar *str,
+ g_return_val_if_fail(file != NULL, -1);
+
+ if ((fp = g_fopen(file, "wb")) == NULL) {
+- FILE_OP_ERROR(file, "fopen");
++ FILE_OP_ERROR(file, "g_fopen");
+ return -1;
+ }
+
+@@ -3147,14 +3158,14 @@ static gchar *file_read_to_str_full(cons
+ }
+
+ #ifdef G_OS_WIN32
+- fp = fopen (file, "rb");
++ fp = g_fopen (file, "rb");
+ if (fp == NULL) {
+ FILE_OP_ERROR(file, "open");
+ return NULL;
+ }
+ #else
+ /* test whether the file is readable without blocking */
+- fd = open(file, O_RDONLY | O_NONBLOCK);
++ fd = g_open(file, O_RDONLY | O_NONBLOCK);
+ if (fd == -1) {
+ FILE_OP_ERROR(file, "open");
+ return NULL;
+@@ -4572,7 +4583,7 @@ gchar *make_http_string(const gchar *bp,
+
+ static gchar *mailcap_get_command_in_file(const gchar *path, const gchar *type, const gchar *file_to_open)
+ {
+- FILE *fp = fopen(path, "rb");
++ FILE *fp = g_fopen(path, "rb");
+ gchar buf[BUFFSIZE];
+ gchar *result = NULL;
+ if (!fp)
+@@ -4685,8 +4696,8 @@ void mailcap_update_default(const gchar
+ gchar *path = NULL, *outpath = NULL;
+ path = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".mailcap", NULL);
+ outpath = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".mailcap.new", NULL);
+- FILE *fp = fopen(path, "rb");
+- FILE *outfp = fopen(outpath, "wb");
++ FILE *fp = g_fopen(path, "rb");
++ FILE *outfp = g_fopen(outpath, "wb");
+ gchar buf[BUFFSIZE];
+ gboolean err = FALSE;
+
+Index: src/etpan/imap-thread.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/etpan/Attic/imap-thread.c,v
+retrieving revision 1.1.4.107
+retrieving revision 1.1.4.108
+diff -u -p -u -r1.1.4.107 -r1.1.4.108
+--- src/etpan/imap-thread.c 9 Jan 2009 17:47:14 -0000 1.1.4.107
++++ src/etpan/imap-thread.c 17 Jan 2009 16:24:31 -0000 1.1.4.108
+@@ -2459,7 +2459,7 @@ static void fetch_content_run(struct etp
+ result->error = r;
+
+ if (r == MAILIMAP_NO_ERROR) {
+- fd = open(param->filename, O_RDWR | O_CREAT, 0600);
++ fd = g_open(param->filename, O_RDWR | O_CREAT, 0600);
+ if (fd < 0) {
+ result->error = MAILIMAP_ERROR_FETCH;
+ goto free;
+@@ -2960,7 +2960,7 @@ static void append_run(struct etpan_thre
+ }
+ size = stat_buf.st_size;
+
+- fd = open(param->filename, O_RDONLY);
++ fd = g_open(param->filename, O_RDONLY);
+ if (fd < 0) {
+ result->error = MAILIMAP_ERROR_APPEND;
+ return;
+@@ -3246,7 +3246,7 @@ static void do_exec_command(int fd, cons
+ /* Detach from the controlling tty if we have one. Otherwise,
+ SSH might do something stupid like trying to use it instead
+ of running $SSH_ASKPASS. Doh. */
+- fd = open("/dev/tty", O_RDONLY);
++ fd = g_open("/dev/tty", O_RDONLY);
+ if (fd != -1) {
+ ioctl(fd, TIOCNOTTY, NULL);
+ close(fd);
+Index: src/plugins/bogofilter/bogofilter.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/plugins/bogofilter/Attic/bogofilter.c,v
+retrieving revision 1.1.2.39
+retrieving revision 1.1.2.40
+diff -u -p -u -r1.1.2.39 -r1.1.2.40
+--- src/plugins/bogofilter/bogofilter.c 9 Jan 2009 17:47:19 -0000 1.1.2.39
++++ src/plugins/bogofilter/bogofilter.c 17 Jan 2009 16:24:31 -0000 1.1.2.40
+@@ -272,8 +272,8 @@ static void bogofilter_do_filter(BogoFil
+ FOLDER_TYPE(msginfo->folder->folder) == F_MH &&
+ config.insert_header) {
+ gchar *tmpfile = get_tmp_file();
+- FILE *input = fopen(file, "r");
+- FILE *output = fopen(tmpfile, "w");
++ FILE *input = g_fopen(file, "r");
++ FILE *output = g_fopen(tmpfile, "w");
+ if (strstr(parts[2], "\n"))
+ *(strstr(parts[2], "\n")) = '\0';
+ if (input && !output)
+Index: src/plugins/pgpinline/pgpinline.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/plugins/pgpinline/Attic/pgpinline.c,v
+retrieving revision 1.1.2.42
+retrieving revision 1.1.2.43
+diff -u -p -u -r1.1.2.42 -r1.1.2.43
+--- src/plugins/pgpinline/pgpinline.c 9 Jan 2009 17:47:21 -0000 1.1.2.42
++++ src/plugins/pgpinline/pgpinline.c 17 Jan 2009 16:24:31 -0000 1.1.2.43
+@@ -133,7 +133,7 @@ static gchar *get_part_as_string(MimeInf
+ printf("error dumping file\n");
+ return NULL;
+ }
+- fp = fopen(filename,"rb");
++ fp = g_fopen(filename,"rb");
+ if (!fp) {
+ printf("error reading file\n");
+ return NULL;
+Index: src/plugins/smime/smime.c
+===================================================================
+RCS file: /srv/cvs/claws-mail/claws/src/plugins/smime/Attic/smime.c,v
+retrieving revision 1.1.2.3
+retrieving revision 1.1.2.4
+diff -u -p -u -r1.1.2.3 -r1.1.2.4
+--- src/plugins/smime/smime.c 9 Jan 2009 17:47:22 -0000 1.1.2.3
++++ src/plugins/smime/smime.c 17 Jan 2009 16:24:32 -0000 1.1.2.4
+@@ -430,7 +430,7 @@ static MimeInfo *smime_decrypt(MimeInfo
+ get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
+
+ if ((dstfp = g_fopen(fname, "wb")) == NULL) {
+- FILE_OP_ERROR(fname, "fopen");
++ FILE_OP_ERROR(fname, "g_fopen");
+ g_free(fname);
+ gpgme_data_release(plain);
+ gpgme_release(ctx);
+@@ -795,7 +795,7 @@ gboolean smime_encrypt(MimeInfo *mimeinf
+
+ /* write message content to temporary file */
+ tmpfile = get_tmp_file();
+- fp = fopen(tmpfile, "wb");
++ fp = g_fopen(tmpfile, "wb");
+ if (fp == NULL) {
+ perror("get_tmp_file");
+ return FALSE;
+@@ -805,7 +805,7 @@ gboolean smime_encrypt(MimeInfo *mimeinf
+ procmime_write_mimeinfo(msgcontent, fp);
+ fclose(fp);
+ canonicalize_file_replace(tmpfile);
+- fp = fopen(tmpfile, "rb");
++ fp = g_fopen(tmpfile, "rb");
+ if (fp == NULL) {
+ perror("get_tmp_file");
+ return FALSE;
+@@ -834,7 +834,7 @@ gboolean smime_encrypt(MimeInfo *mimeinf
+ }
+
+ tmpfile = get_tmp_file();
+- fp = fopen(tmpfile, "wb");
++ fp = g_fopen(tmpfile, "wb");
+ if (fp) {
+ if (fwrite(enccontent, 1, len, fp) < len) {
+ FILE_OP_ERROR(tmpfile, "fwrite");
Property changes on: trunk/patches/claws-mail-3.7.0/06-bug_1825.patch
___________________________________________________________________
Name: svn:executable
+ *
More information about the Gpg4win-commits
mailing list