From 33b846810cf4e8d29e38b25246e676438ae5a1bf Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 20 Nov 2008 18:12:31 +0000 Subject: users/13464: allow MIME suffixes to match upper case variants 26075: fix repeated calendar events so that the next event is always in the future --- Functions/Calendar/calendar_parse | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Functions/Calendar/calendar_parse') diff --git a/Functions/Calendar/calendar_parse b/Functions/Calendar/calendar_parse index f856a4f77..e53e97516 100644 --- a/Functions/Calendar/calendar_parse +++ b/Functions/Calendar/calendar_parse @@ -28,6 +28,7 @@ setopt extendedglob local REPLY REPLY2 local -a match mbegin mend +integer now autoload -U calendar_scandate @@ -70,6 +71,17 @@ while (( changed )); do reply[rpttime]=$REPLY reply[rptstr]=${match[2]%%"$REPLY2"} reply[text2]="${match[1]}${REPLY2##[[:space:]]#}" + (( now = EPOCHSECONDS )) + while (( ${reply[rpttime]} < now )); do + # let's hope the original appointment wasn't in 44 B.C. + if calendar_scandate -a -R ${reply[rpttime]} ${reply[rptstr]}; then + if (( REPLY <= ${reply[rpttime]} )); then + # pathological case + break; + fi + reply[rpttime]=$REPLY + fi + done else # Just remove the keyword for further parsing reply[text2]="${match[1]}${match[2]##[[:space:]]#}" -- cgit 1.4.1