[Commits] [SCM] claws branch, master, updated. 3.12.0-49-gbf373b8

ticho at claws-mail.org ticho at claws-mail.org
Thu Aug 13 20:26:37 CEST 2015


The branch, master has been updated
       via  bf373b8226f1b3b335619a75de80041ee5ad9761 (commit)
      from  b20b2b3508765ce95842aff8e13feb86ff2b599a (commit)

Summary of changes:
 src/common/utils.c |   18 ++++++++++++++++++
 src/common/utils.h |    5 +++++
 src/unmime.c       |    1 +
 3 files changed, 24 insertions(+)


- Log -----------------------------------------------------------------
commit bf373b8226f1b3b335619a75de80041ee5ad9761
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Aug 13 20:24:48 2015 +0200

    Provide an up to date version of g_base64_decode() for older GLib.
    
    Patch by Jean Diraison, closes bug #3473.

diff --git a/src/common/utils.c b/src/common/utils.c
index b753ac8..64ca25a 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -89,6 +89,24 @@ static gboolean debug_mode = FALSE;
 static GSList *tempfiles=NULL;
 #endif
 
+#if !GLIB_CHECK_VERSION(2, 26, 0)
+guchar *g_base64_decode_wa(const gchar *text, gsize *out_len)
+{
+	guchar *ret;
+	gsize input_length;
+	gint state = 0;
+	guint save = 0;
+
+	input_length = strlen(text);
+
+	ret = g_malloc0((input_length / 4) * 3 + 1);
+
+	*out_len = g_base64_decode_step(text, input_length, ret, &state, &save);
+
+	return ret;
+}
+#endif
+
 /* Return true if we are running as root.  This function should beused
    instead of getuid () == 0.  */
 gboolean superuser_p (void)
diff --git a/src/common/utils.h b/src/common/utils.h
index 3771d45..0a38d34 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -75,6 +75,11 @@ typedef gint64 goffset;
   #define HAVE_U32_TYPEDEF
 #endif
 
+#if !GLIB_CHECK_VERSION(2, 26, 0)
+#define g_base64_decode(t,l)	g_base64_decode_wa((t),(l))
+guchar *g_base64_decode_wa(const gchar *text, gsize *out_len);
+#endif
+
 #if !GLIB_CHECK_VERSION(2, 25, 0)
 # ifdef G_OS_WIN32
 	typedef _g_stat_struct GStatBuf;
diff --git a/src/unmime.c b/src/unmime.c
index e9588e3..424bde9 100644
--- a/src/unmime.c
+++ b/src/unmime.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "utils.h"
 #include "codeconv.h"
 #include "quoted-printable.h"
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list