summaryrefslogtreecommitdiff
path: root/src/recur.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-08-06 09:26:46 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-08-06 12:08:14 +0200
commit9ce586146825200c819662ea8dcb44cc03d2cd53 (patch)
treeca9e9db902574de4da0eb2155d9020b73c695699 /src/recur.c
parentbfe73d0e5d66c43006a8a0dd8d58e311432bcb57 (diff)
downloadcalcurse-9ce586146825200c819662ea8dcb44cc03d2cd53.zip
Add pattern filter option
This adds a new item filter option --filter-pattern and removes the whole -S parameter logic, while making -S an alias for --filter-pattern. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/recur.c')
-rw-r--r--src/recur.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/recur.c b/src/recur.c
index 76585d6..61fd155 100644
--- a/src/recur.c
+++ b/src/recur.c
@@ -380,6 +380,8 @@ struct recur_apoint *recur_apoint_scan(FILE * f, struct tm start,
if (filter) {
if (!(filter->type_mask & TYPE_MASK_RECUR_APPT))
return NULL;
+ if (filter->regex && regexec(filter->regex, buf, 0, 0, 0))
+ return NULL;
if (filter->start_from >= 0 && tstart < filter->start_from)
return NULL;
if (filter->start_to >= 0 && tstart > filter->start_to)
@@ -437,6 +439,8 @@ struct recur_event *recur_event_scan(FILE * f, struct tm start, int id,
if (filter) {
if (!(filter->type_mask & TYPE_MASK_RECUR_EVNT))
return NULL;
+ if (filter->regex && regexec(filter->regex, buf, 0, 0, 0))
+ return NULL;
if (filter->start_from >= 0 && tstart < filter->start_from)
return NULL;
if (filter->start_to >= 0 && tstart > filter->start_to)