Package: plan
Version: 1.9-6
Severity: normal
Tags: patch
Hello,
There is a bug when using when using "last weekday in month" inside
bracketed expressions in holiday file.
For example, the following holiday entry generally returns the last
tuesday in january (instead of february), and sometimes (e.g. in 2005)
the first tuesday of february (instead of the last one).
cyan "FOO" on 1.1. plus [last tuesday in february] days
The next patch corrects the problem.
--- plan-1.9.orig/src/parser.y
+++ plan-1.9/src/parser.y
@@ -98,9 +98,10 @@
($1, $2); }
| WDAY pexpr pexpr { $$ = day_from_wday($3, $1,
$2 == -1 ? -1 : 0); }
- | pexpr WDAY IN month { int d=day_from_monthday($4,1);
+ | pexpr WDAY IN month { int d=day_from_monthday
+ ($4 + ($1 == 999),1);
$$ = $1 == 999
- ? day_from_wday(d+1,$2,-1)
+ ? day_from_wday(d,$2,-1)
: day_from_wday(d,$2,$1-1);}
;
Regards,
Arnaud Giersch
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]