Bug #669003 - CalDAV: Cannot modify calendar object (libical 0.48)
authorMilan Crha <mcrha@redhat.com>
Mon, 30 Jan 2012 18:25:41 +0000 (19:25 +0100)
committerMilan Crha <mcrha@redhat.com>
Mon, 30 Jan 2012 18:25:41 +0000 (19:25 +0100)
calendar/backends/caldav/e-cal-backend-caldav.c

index 694e64a..50cece5 100644 (file)
@@ -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;
 }