HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

y2k patch for xferstats



Hy,

I have changed the xferstats script of HylaFAX 4.0pl2 a bit so that it deal
corectly with logs before 2000 :)

This patch works right for me... i hope so ;)

-------snip-------

--- xferstats.orig	Thu Jan  6 23:27:49 2000
+++ xferstats	Fri Jan  7 19:30:29 2000
@@ -152,7 +152,9 @@
 #
 # Generate an awk program to process the statistics file.
 #
-tmpAwk=/tmp/xfer$$
+#
+#tmpAwk=/tmp/xfer$$		# if you don't have mktemp use this line
+tmpAwk=`mktemp /tmp/xferXXXXXX` || exit 1
 trap "rm -f $tmpAwk; exit 1" 0 1 2 15
 
 ($CAT<<'EOF'
@@ -186,7 +188,12 @@
 #
 function cvtDateTime(s)
 {
-    yday = substr(s,7,2)*365 + substr(s,4,2) - 1;
+    if (substr(s,7,2) >= 70)
+    {
+       yday = (substr(s,7,2) - 70) * 365 + substr(s,4,2) - 1;
+    } else {
+       yday = (substr(s,7,2) + 30) * 365 + substr(s,4,2) - 1;
+    }
     mon = substr(s,0,2) + 0;
     for (i = 0; i < mon; i++)
 	yday += daysInMonth[i];

--------------- 

Bye
	Sascha




Project hosted by iFAX Solutions