evolution r34918 - trunk/mail



Author: sragavan
Date: Mon Jan 28 10:52:18 2008
New Revision: 34918
URL: http://svn.gnome.org/viewvc/evolution?rev=34918&view=rev

Log:
2008-01-28  Srinivasa Ragavan  <sragavan novell com>

	** Fix for bug #506948

	* em-folder-view.c: (url_unescape_amp), (emp_uri_popup_link_copy):
	Copy the unescaped url


Modified:
   trunk/mail/ChangeLog
   trunk/mail/em-folder-view.c

Modified: trunk/mail/em-folder-view.c
==============================================================================
--- trunk/mail/em-folder-view.c	(original)
+++ trunk/mail/em-folder-view.c	Mon Jan 28 10:52:18 2008
@@ -2758,6 +2758,37 @@
 	}
 }
 
+static gchar *
+url_unescape_amp (const gchar *url)
+{
+	gchar *buff;
+	int i, j, amps;
+
+	if (!url)
+		return NULL;
+
+	amps = 0;
+	for (i = 0; url [i]; i++) {
+		if (url [i] == '&' && strncmp (url + i, "&amp;", 5) == 0)
+			amps++;
+	}
+
+	buff = g_strdup (url);
+
+	if (!amps)
+		return buff;
+
+	for (i = 0, j = 0; url [i]; i++, j++) {
+		buff [j] = url [i];
+
+		if (url [i] == '&' && strncmp (url + i, "&amp;", 5) == 0)
+			i += 4;
+	}
+	buff [j] = 0;
+
+	return buff;
+}
+
 static void
 emp_uri_popup_link_copy(EPopup *ep, EPopupItem *pitem, void *data)
 {
@@ -2765,7 +2796,7 @@
 	struct _EMFolderViewPrivate *p = emfv->priv;
 
 	g_free(p->selection_uri);
-	p->selection_uri = g_strdup(pitem->user_data);
+	p->selection_uri = url_unescape_amp(pitem->user_data);
 
 	gtk_selection_owner_set(p->invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time());
 	gtk_selection_owner_set(p->invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time());



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