From ed975fa25368ea637ca9ab1e58e04b5e5364eda7 Mon Sep 17 00:00:00 2001
From: Jeffrey Stedfast <fejj@ximian.com>
Date: Mon, 24 Mar 2003 19:34:11 +0000
Subject: This expression can never return an array. We must always return a
 string

2003-03-24  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-folder-search.c (search_user_tag): This expression can
	never return an array. We must always return a string value.

svn path=/trunk/; revision=20487
---
 camel/ChangeLog             |  5 +++++
 camel/camel-folder-search.c | 27 +++++++++++----------------
 2 files changed, 16 insertions(+), 16 deletions(-)

(limited to 'camel')

diff --git a/camel/ChangeLog b/camel/ChangeLog
index e2d39d4a7b..9b22d11fe9 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2003-03-24  Jeffrey Stedfast  <fejj@ximian.com>
+
+	* camel-folder-search.c (search_user_tag): This expression can
+	never return an array. We must always return a string value.
+
 2003-03-24  Timo Sirainen  <tss@iki.fi>
 
 	* camel-imap-command.c (imap_read_untagged) Integer overflow fix.
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index ef6dfc8564..00315fafdc 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -1052,25 +1052,20 @@ search_system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, Came
 	return r;
 }
 
-static ESExpResult *search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
+static ESExpResult *
+search_user_tag(struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFolderSearch *search)
 {
+	const char *value = NULL;
 	ESExpResult *r;
-
+	
 	r(printf("executing user-tag\n"));
-
-	/* are we inside a match-all? */
-	if (search->current) {
-		const char *value = NULL;
-		if (argc == 1) {
-			value = camel_tag_get(&search->current->user_tags, argv[0]->value.string);
-		}
-		r = e_sexp_result_new(f, ESEXP_RES_STRING);
-		r->value.string = g_strdup(value?value:"");
-	} else {
-		r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
-		r->value.ptrarray = g_ptr_array_new();
-	}
-
+	
+	if (argc == 1)
+		value = camel_tag_get (&search->current->user_tags, argv[0]->value.string);
+	
+	r = e_sexp_result_new(f, ESEXP_RES_STRING);
+	r->value.string = g_strdup (value ? value : "");
+	
 	return r;
 }
 
-- 
cgit