summaryrefslogtreecommitdiff
blob: 47a7ed8b1e0e644109bc9f4c337876d7f2bb3e32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
commit 830fa86226aa2c4fd0687aef605c93920888e3c4
Author: Milan Crha <mcrha@redhat.com>
Date:   Mon Jan 30 19:25:41 2012 +0100

    Bug #669003 - CalDAV: Cannot modify calendar object (libical 0.48)

diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index 694e64a..50cece5 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -422,6 +422,24 @@ ecalcomp_get_etag (ECalComponent *comp)
 
 	str =  icomp_x_prop_get (icomp, X_E_CALDAV "ETAG");
 
+	/* libical 0.48 escapes quotes, thus unescape them */
+	if (str && strchr (str, '\\')) {
+		gint ii, jj;
+
+		for (ii = 0, jj = 0; str[ii]; ii++) {
+			if (str[ii] == '\\') {
+				ii++;
+				if (!str[ii])
+					break;
+			}
+
+			str[jj] = str[ii];
+			jj++;
+		}
+
+		str[jj] = 0;
+	}
+
 	return str;
 }