aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-14 19:58:05 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-14 19:58:05 +0400
commitd56c45424b51b33117777f1456134e48c35d5a60 (patch)
tree3a6ce4158464b9851274074e6add426d75d534fe
parenteb37f21a76f9e30e06bf1c80b2b20d05820a9f93 (diff)
downloadrspamd-d56c45424b51b33117777f1456134e48c35d5a60.tar.gz
rspamd-d56c45424b51b33117777f1456134e48c35d5a60.zip
Another fix for comparing parts without content - two empty parts are equal.
-rw-r--r--src/fuzzy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fuzzy.c b/src/fuzzy.c
index 21ac1eef9..55ed6b9ff 100644
--- a/src/fuzzy.c
+++ b/src/fuzzy.c
@@ -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);