summaryrefslogtreecommitdiff
path: root/www/htdig-devel/patches/patch-ab
blob: 62fa7c5b199d46a9e532414d574221e3075c370e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
$NetBSD: patch-ab,v 1.1 2009/01/17 09:13:10 adam Exp $

--- htsearch/Display.cc.orig	2009-01-17 10:05:37.000000000 +0100
+++ htsearch/Display.cc
@@ -1541,7 +1541,7 @@ Display::buildMatchList()
 // seconds in a 365 days year). The formula gives less weight
 // as the distance between the date document and the current time
 // increases (the absolute value is for documents with future date)
-#define DATE_FACTOR(df, n, dd) ((df) * 100 / (1+(double)(abs((n) - (dd)) / 31536000)))
+#define DATE_FACTOR(df, n, dd) ((df) * 100 / (1+(double)(abs((int)((n) - (dd))) / 31536000)))
 	    date_score =  DATE_FACTOR(date_factor, now, thisRef->DocTime());
 	    score += date_score;
         }