gmime r1203 - in trunk: . gmime



Author: fejj
Date: Tue Jan 15 01:00:31 2008
New Revision: 1203
URL: http://svn.gnome.org/viewvc/gmime?rev=1203&view=rev

Log:
2008-01-14  Jeffrey Stedfast  <fejj novell com>

	* gmime/gmime-charset.c (g_mime_set_user_charsets): Deep copy the
	string array. Fixes bug #509434.



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/gmime/gmime-charset.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Jan 15 01:00:31 2008
@@ -136,14 +136,6 @@
   CFLAGS="-O0 -g -pg"
 fi
 
-AC_ARG_ENABLE(rfc2047-workarounds,
-              AC_HELP_STRING([--enable-rfc2047-workarounds],
-	      [enable workarounds for broken rfc2047 encodings [[default=no]]]),,
-	      enable_rfc2047_workarounds=no)
-if test "x$enable_rfc2047_workarounds" = "xyes"; then
-  AC_DEFINE(ENABLE_RFC2047_WORKAROUNDS, 1, [Define if GMime should enable workarounds for broken rfc2047 encodings.])
-fi
-
 dnl Enable warning spewage on the console
 AC_ARG_ENABLE(warnings,
               AC_HELP_STRING([--enable-warnings],
@@ -238,6 +230,15 @@
 	AC_MSG_RESULT(no)
 )
 
+dnl Check if we should work around broken rfc2047 encodings
+AC_ARG_ENABLE(rfc2047-workarounds,
+              AC_HELP_STRING([--enable-rfc2047-workarounds],
+	      [enable workarounds for broken rfc2047 encodings [[default=no]]]),,
+	      enable_rfc2047_workarounds=no)
+if test "x$enable_rfc2047_workarounds" = "xyes"; then
+  AC_DEFINE(ENABLE_RFC2047_WORKAROUNDS, 1, [Define if GMime should enable workarounds for broken rfc2047 encodings.])
+fi
+
 dnl Check for MAXHOSTNAMELEN
 AC_MSG_CHECKING(for MAXHOSTNAMELEN)
 AC_TRY_COMPILE([
@@ -268,7 +269,6 @@
 	AC_MSG_RESULT(no)
 )
 
-
 dnl Timezone checks
 AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
 	AC_TRY_COMPILE([

Modified: trunk/gmime/gmime-charset.c
==============================================================================
--- trunk/gmime/gmime-charset.c	(original)
+++ trunk/gmime/gmime-charset.c	Tue Jan 15 01:00:31 2008
@@ -909,22 +909,12 @@
 	if (user_charsets)
 		g_strfreev (user_charsets);
 	
-	if (charsets == NULL) {
+	if (charsets == NULL || charsets[0] == NULL) {
 		user_charsets = NULL;
 		return;
 	}
 	
-	while (charsets[n] != NULL)
-		n++;
-	
-	if (n == 0) {
-		user_charsets = NULL;
-		return;
-	}
-	
-	user_charsets = g_malloc (sizeof (char *) * (n + 1));
-	for (i = 0; i <= n; i++)
-		user_charsets[i] = (char *) charsets[i];
+	user_charsets = g_strdupv ((char **) charsets);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]