[evolution] Bug #678293 - Already downloaded images are not shown



commit 9e88dd64e742d19ab133477921d7c20b9654ee0b
Author: Dan VrÃtil <dvratil redhat com>
Date:   Tue Jun 19 10:26:19 2012 +0200

    Bug #678293 - Already downloaded images are not shown

 mail/e-http-request.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index 734496b..682b806 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -224,6 +224,7 @@ handle_http_request (GSimpleAsyncResult *res,
 	CamelStream *cache_stream;
 
 	GHashTable *query;
+	gint uri_len;
 
 	if (g_cancellable_is_cancelled (cancellable)) {
 		return;
@@ -250,8 +251,15 @@ handle_http_request (GSimpleAsyncResult *res,
 	evo_uri = soup_uri_to_string (soup_uri, FALSE);
 
 	/* Remove the "evo-" prefix from scheme */
-	if (evo_uri && (strlen (evo_uri) > 5)) {
-		uri = g_strdup (&evo_uri[4]);
+	uri_len = strlen (evo_uri);
+	if (evo_uri && (uri_len > 5)) {
+
+		/* Remove trailing "?" if there is no URI query */
+		if (evo_uri[uri_len - 1] == '?') {
+			uri = g_strndup (evo_uri + 4, uri_len - 5);
+		} else {
+			uri = g_strdup (evo_uri + 4);
+		}
 		g_free (evo_uri);
 	}
 



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