HylaFAX The world's most advanced open source fax server

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

[hylafax-users] hylafax faxcron bug with origin-1 substr (also, --lint suggestion)



Here's a patch for a typo in util/faxcron.sh.in.  The code assumes
that awk substr is origin-0, but it's really origin-1.  Most awk
implementations silently convert the 0 to a 1, but mawk doesn't.

Suggestion: Hylafax 'configure' could configure Hylfax to use "$AWK
--lint" if it detects that the awk implementation is gawk.  That would
help catch typos like this.  This could be done by using a new AWKOPTS
variable that is '--lint' if --lint works, and empty otherwise.


diff -pu -r1.7 -r1.7.0.1
--- util/faxcron.sh.in	2000/06/18 06:12:17	1.7
+++ util/faxcron.sh.in	2000/07/20 16:21:24	1.7.0.1
@@ -365,7 +365,7 @@ function setupDateTimeStuff()
 #
 function cvtTime(s)
 {
-    mon = Months[substr(s, 0, 3)];
+    mon = Months[substr(s, 1, 3)];
     yday = substr(s, 5, 2) - 1;
     for (i = 0; i < mon; i++)
 	yday += daysInMonth[i];


____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null




Project hosted by iFAX Solutions