]> source.dussan.org Git - rspamd.git/commitdiff
Another fix for comparing parts without content - two empty parts are equal.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 14 Jul 2011 15:58:05 +0000 (19:58 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 14 Jul 2011 15:58:05 +0000 (19:58 +0400)
src/fuzzy.c

index 21ac1eef9384e829a16b723fe84dcc4a746898d9..55ed6b9ffe5c911db05ebcbaa668e0ae5977bc99 100644 (file)
@@ -461,7 +461,12 @@ fuzzy_compare_hashes (fuzzy_hash_t * h1, fuzzy_hash_t * h2)
        l2 = strlen (h2->hash_pipe);
 
        if (l1 == 0 || l2 == 0) {
-               return 0;
+               if (l1 == 0 && l2 == 0) {
+                       return 100;
+               }
+               else {
+                       return 0;
+               }
        }
 
        res = lev_distance (h1->hash_pipe, l1, h2->hash_pipe, l2);