[exim-dev] Finding the haystack in the needle; Sieve envelop…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Bob Johannessen
Dátum:  
Címzett: exim-dev
CC: michael
Tárgy: [exim-dev] Finding the haystack in the needle; Sieve envelope bug
I couldn't for the life of me get Sieve envelope tests to work with
match types other then :is, so I went looking for the reason in the
source (all line numbers refer to the 2005/03/29 snapshot from
exim.org). Looks to me like the call to compare() in line 2059 reverses
the arguments for needle and haystack, which is consistent with the
behavior I'm seeing (it only matches if the two strings are exactly the
same). The patch below solves the problem for me, but I'll leave it to
Michael to decide if it's correct or not.


    Bob



--- sieve.c-orig        2005-03-30 19:46:51.000000000 +0000
+++ sieve.c     2005-03-30 19:47:08.000000000 +0000
@@ -2056,7 +2056,7 @@


         envelopeStr.character=envelope;
         envelopeStr.length=Ustrlen(envelope);
-        *cond=compare(filter,&envelopeStr,k,comparator,matchType);
+        *cond=compare(filter,k,&envelopeStr,comparator,matchType);
         if (*cond==-1) return -1;
         if (*cond) break;
         }