aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src
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/src
parentd0b75d273ffbe05581c1cea3b8fcbb6447e0bc5e (diff)
downloadgsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar
gsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar.gz
gsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar.bz2
gsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar.lz
gsoc2013-evolution-84e6a5344f98f4b64b7316485c3f7a3c8bf8da33.tar.xz
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/src')
-rw-r--r--libical/src/libical/icalrecur.c17
1 files changed, 7 insertions, 10 deletions
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);