aboutsummaryrefslogtreecommitdiffstats
path: root/libical
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-01-29 05:47:39 +0800
committerDan Winship <danw@src.gnome.org>2002-01-29 05:47:39 +0800
commit84e6a5344f98f4b64b7316485c3f7a3c8bf8da33 (patch)
treedac3ee42c4c2f38282afabdba562bc4f749a8433 /libical
parentd0b75d273ffbe05581c1cea3b8fcbb6447e0bc5e (diff)
downloadgsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar.gz
gsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar.zst
gsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.zip
Skip over illegal whitespace in Microsoft-generated BYDAY rules.
* src/libical/icalrecur.c (icalrecur_add_bydayrules): Skip over illegal whitespace in Microsoft-generated BYDAY rules. svn path=/trunk/; revision=15497
Diffstat (limited to 'libical')
-rw-r--r--libical/ChangeLog5
-rw-r--r--libical/src/libical/icalrecur.c17
2 files changed, 12 insertions, 10 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index c25200cf33..5d215cedfb 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-28 Dan Winship <danw@ximian.com>
+
+ * src/libical/icalrecur.c (icalrecur_add_bydayrules): Skip over
+ illegal whitespace in Microsoft-generated BYDAY rules.
+
2001-12-18 Damon Chaplin <damon@ximian.com>
* src/libical/icalyacc.y: removed unused 'trigger:' production.
diff --git a/libical/src/libical/icalrecur.c b/libical/src/libical/icalrecur.c
index 5701e251e5..b12dbabca2 100644
--- a/libical/src/libical/icalrecur.c
+++ b/libical/src/libical/icalrecur.c
@@ -338,17 +338,14 @@ void icalrecur_add_bydayrules(struct icalrecur_parser *parser, const char* vals)
sign = 1;
}
- weekno = 0;
/* Get Optional weekno */
- if( sscanf(t,"%d",&weekno) != 0){
- if (n != 0){
- int weeknolen = (n-t)-3; /* 3 -> one for \0, 2 for day name */
- /* could use abs(log10(weekno))+1, but that needs libm */
- t += weeknolen;
- } else {
- t = end -2;
- }
- }
+ weekno = strtol(t,&t,10);
+
+ /* Outlook/Exchange generate "BYDAY=MO, FR" and "BYDAY=2 TH".
+ * Cope with that.
+ */
+ if (*t == ' ')
+ t++;
wd = icalrecur_string_to_weekday(t);