From f94b2023ad2b205697d2bad8ec7cc92434f41605 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Thu, 9 Aug 2001 02:27:40 +0000 Subject: Remove trailing stuff from URLs before returning. (Done in an evil way, 2001-08-08 Jon Trowbridge * camel-filter-search.c (get_source): Remove trailing stuff from URLs before returning. (Done in an evil way, not in the good way suggested by fejj. :)) (Bug #4876) svn path=/trunk/; revision=11808 --- camel/ChangeLog | 6 ++++++ camel/camel-filter-search.c | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 80c7053000..dd3e285e82 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2001-08-08 Jon Trowbridge + + * camel-filter-search.c (get_source): Remove trailing stuff from + URLs before returning. (Done in an evil way, not in the good way + suggested by fejj. :)) (Bug #4876) + 2001-08-08 jacob berkman * camel-search-private.c (camel_search_header_match): check for diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c index bbfbac249f..9cbb87cce6 100644 --- a/camel/camel-filter-search.c +++ b/camel/camel-filter-search.c @@ -403,13 +403,25 @@ static ESExpResult * get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) { ESExpResult *r; + char *src; + char *tmp; r = e_sexp_result_new (f, ESEXP_RES_STRING); if (fms->source) { - r->value.string = e_url_shroud (fms->source); + src = e_url_shroud (fms->source); } else { - r->value.string = g_strdup (camel_mime_message_get_source (fms->message)); + src = g_strdup (camel_mime_message_get_source (fms->message)); } + + /* This is an abusive hack */ + if ( src && (tmp = strstr (src, "://")) ) { + tmp += 3; + tmp = strchr (tmp, '/'); + if (tmp) + *tmp = '\0'; + } + + r->value.string = src; return r; } -- cgit v1.2.3