diff options
author | Milan Crha <mcrha@redhat.com> | 2008-01-10 20:04:00 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-01-10 20:04:00 +0800 |
commit | 3b1751690acdcfc8abc5ceb0c374724ccf50df36 (patch) | |
tree | da7475d19285abf2c0cd946d2b31146769167e6f /mail/em-format-html-display.c | |
parent | e562721c90b84a425ffcf230e802da0a3e751599 (diff) | |
download | gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.tar gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.tar.gz gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.tar.bz2 gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.tar.lz gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.tar.xz gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.tar.zst gsoc2013-evolution-3b1751690acdcfc8abc5ceb0c374724ccf50df36.zip |
** Fix for bug #507067
2008-01-10 Milan Crha <mcrha@redhat.com>
** Fix for bug #507067
* em-format-html-display.c: (efhd_get_uri_puri):
Leak fix and enhanced behavior to return more than one URI separated
by new line character ('\n'), if possible.
* em-folder-view.c: (emfv_uri_popup_free): Free item itself too,
because since now we use new allocated items, not the static one.
* em-folder-view.c: (emfv_free_em_popup), (emfv_append_menu),
(emfv_format_popup_event): Merge menus for more URIs and for part too.
svn path=/trunk/; revision=34790
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r-- | mail/em-format-html-display.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 8589564bd6..6da3096774 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -854,21 +854,39 @@ efhd_get_uri_puri (GtkWidget *html, GdkEventButton *event, EMFormatHTMLDisplay * img_url = gtk_html_get_cursor_image_src (GTK_HTML (html)); } - if (!url && img_url) { - if (strstr (img_url, "://") || g_ascii_strncasecmp (img_url, "cid:", 4) == 0) { - url = img_url; - img_url = NULL; - } else - url = g_strconcat ("file://", img_url, NULL); + if (img_url) { + if (!(strstr (img_url, "://") || g_ascii_strncasecmp (img_url, "cid:", 4) == 0)) { + char *u = g_strconcat ("file://", img_url, NULL); + g_free (img_url); + img_url = u; + } } - if (url && puri) - *puri = em_format_find_puri((EMFormat *)efhd, url); + if (puri) { + if (url) + *puri = em_format_find_puri ((EMFormat *)efhd, url); + + if (!*puri && img_url) + *puri = em_format_find_puri ((EMFormat *)efhd, img_url); + } if (uri) { - *uri = url; - url = NULL; + *uri = NULL; + if (img_url && g_ascii_strncasecmp (img_url, "cid:", 4) != 0) { + if (url) + *uri = g_strdup_printf ("%s\n%s", url, img_url); + else { + *uri = img_url; + img_url = NULL; + } + } else { + *uri = url; + url = NULL; + } } + + g_free (url); + g_free (img_url); } static int |