[dovecot-cvs] dovecot/src/lib-storage/index index-search.c,1.67,1.68

cras at procontrol.fi cras at procontrol.fi
Sat Feb 1 13:37:24 EET 2003


Update of /home/cvs/dovecot/src/lib-storage/index
In directory danu:/tmp/cvs-serv18331/lib-storage/index

Modified Files:
	index-search.c 
Log Message:
Fixes to SEARCH SENT*



Index: index-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- index-search.c	1 Feb 2003 11:24:17 -0000	1.67
+++ index-search.c	1 Feb 2003 11:37:22 -0000	1.68
@@ -405,6 +405,7 @@
 		case SEARCH_SENTON:
 		case SEARCH_SENTSINCE:
 			ret = search_sent(arg->type, arg->value.str, field);
+			break;
 		default:
 			if (arg->value.str[0] == '\0') {
 				/* we're just testing existence of the field.
@@ -467,8 +468,9 @@
 		/* date is handled differently than others */
 		if (ctx->name_len == 4 &&
 		    memcasecmp(ctx->name, "Date", 4) == 0) {
-			search_sent(arg->type, arg->value.str,
-				    t_strndup(ctx->value, ctx->value_len));
+			ret = search_sent(arg->type, arg->value.str,
+				t_strndup(ctx->value, ctx->value_len));
+			ARG_SET_RESULT(arg, ret);
 		}
 		return;
 
@@ -548,6 +550,15 @@
 				  void *context __attr_unused__)
 {
 	switch (arg->type) {
+	case SEARCH_SENTBEFORE:
+	case SEARCH_SENTON:
+	case SEARCH_SENTSINCE:
+		if (arg->not) {
+			/* date header not found, so we match only for
+			   NOT searches */
+			ARG_SET_RESULT(arg, 0);
+		}
+		break;
 	case SEARCH_FROM:
 	case SEARCH_TO:
 	case SEARCH_CC:




More information about the dovecot-cvs mailing list