r12768 - in /desktop/unstable/bug-buddy/debian: changelog patches/01_email-rfc3696.patch

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Sun Sep 23 13:38:04 UTC 2007


Author: sjoerd
Date: Sun Sep 23 13:38:03 2007
New Revision: 12768

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=12768
Log:
* 01_email-rfc3696.patch: Made the code simpler and not free data it
  shouldn't

Modified:
    desktop/unstable/bug-buddy/debian/changelog
    desktop/unstable/bug-buddy/debian/patches/01_email-rfc3696.patch

Modified: desktop/unstable/bug-buddy/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/bug-buddy/debian/changelog?rev=12768&op=diff
==============================================================================
--- desktop/unstable/bug-buddy/debian/changelog (original)
+++ desktop/unstable/bug-buddy/debian/changelog Sun Sep 23 13:38:03 2007
@@ -3,8 +3,10 @@
   * 02_disable_breakpad.patch: Changed so configure provides a
     --disable-google-breakpad option. Also fixes ftbs on i386 (Closes: #443588)
   * debian/rules: Add --disable-google-breakpad to DEB_CONFIGURE_EXTRA_FLAGS
-
- -- Sjoerd Simons <sjoerd at debian.org>  Sun, 23 Sep 2007 12:58:57 +0200
+  * 01_email-rfc3696.patch: Made the code simpler and not free data it
+    shouldn't
+
+ -- Sjoerd Simons <sjoerd at debian.org>  Sun, 23 Sep 2007 15:34:19 +0200
 
 bug-buddy (2.20.0-2) unstable; urgency=low
 

Modified: desktop/unstable/bug-buddy/debian/patches/01_email-rfc3696.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/bug-buddy/debian/patches/01_email-rfc3696.patch?rev=12768&op=diff
==============================================================================
--- desktop/unstable/bug-buddy/debian/patches/01_email-rfc3696.patch (original)
+++ desktop/unstable/bug-buddy/debian/patches/01_email-rfc3696.patch Sun Sep 23 13:38:03 2007
@@ -1,59 +1,55 @@
-diff -ruN bug-buddy-2.18.1/src/bug-buddy.c bug-buddy-2.18.1-email-rfc3696/src/bug-buddy.c
---- bug-buddy-2.18.1/src/bug-buddy.c	2007-02-19 04:25:18.000000000 +1100
-+++ bug-buddy-2.18.1-email-rfc3696/src/bug-buddy.c	2007-07-19 15:15:49.000000000 +1000
-@@ -825,12 +825,9 @@
+Index: src/bug-buddy.c
+===================================================================
+--- src/bug-buddy.c	(revision 2429)
++++ src/bug-buddy.c	(working copy)
+@@ -823,14 +823,11 @@
  		return FALSE;
  
  	for (character = local_part; *character; character++) {
 -		/* If character is alphanumeric it is valid. */
 -		if (g_ascii_isalnum (*character))
--			continue;
--
--		/* If character is "-", "_" or "." it is valid. */
--		if (*character == '-' || *character == '_' || *character == '.')
 +		/* RFC 3696 says *any* printable ASCII character can
 +		 * appear in local-part, subject to quoting rules. */
 +		if (g_ascii_isprint (*character))
  			continue;
  
+-		/* If character is "-", "_" or "." it is valid. */
+-		if (*character == '-' || *character == '_' || *character == '.')
+-			continue;
+-
  		/* Not valid character, not valid local part. */
-@@ -905,21 +902,30 @@
+ 		return FALSE;
+ 	}
+@@ -903,21 +900,25 @@
  {
  	char *local_part;
  	char *domain;
 -	char **parts;
-+	char *address_reversed;
-+	char **parts_reversed;
++	char *at_sign;
  	gboolean is_valid;
  
 -	parts = g_strsplit (address, "@", 2);
-+	/* Split on the *last* '@' character:
-+	 * First reverse the address, then split, then reverse each
-+	 * part back to normal */
-+	address_reversed = g_strreverse (address);
-+	parts_reversed = g_strsplit (address_reversed, "@", 2);
-+	domain = g_strreverse (parts_reversed[0]);
-+	local_part = g_strreverse (parts_reversed[1]);
-+	g_strfreev (parts_reversed);
-+	g_strfreev (address_reversed);
++	/* Split on the *last* '@' character: */
++	at_sign = strrchr (address, '@');
  
- 	/* Check we have the 2 parts */
+-	/* Check we have the 2 parts */
 -	if (!(local_part = parts[0]) || !(domain = parts[1])) {
 -		g_strfreev (parts);
--		return FALSE;
-+	if (!(local_part) || !(domain)) {
-+		/* We don't have both parts, address can't be valid */
-+		is_valid = FALSE;
-+	} else {
-+		/* Check each part is valid */
-+		is_valid = email_local_part_is_valid (local_part)
-+			&& email_domain_is_valid (domain);
- 	}
++	if (at_sign == NULL) 
+ 		return FALSE;
+-	}
  
--	is_valid = email_local_part_is_valid (local_part)
--		&& email_domain_is_valid (domain);
--
++	local_part = g_strndup (address, at_sign - address);
++	domain = g_strdup (at_sign + 1);
++
++	/* Check each part is valid */
+ 	is_valid = email_local_part_is_valid (local_part)
+ 		&& email_domain_is_valid (domain);
+ 
 -	g_strfreev (parts);
++	g_free (local_part);
++	g_free (domain);
++
  	return is_valid;
  }
  




More information about the pkg-gnome-commits mailing list