aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);