]> www.infradead.org Git - users/dwmw2/ews-sync.git/commitdiff
Cope with XML files without the spurious newline at the start
authorDavid Woodhouse <dwmw2@infradead.org>
Thu, 22 Jul 2010 12:10:56 +0000 (13:10 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 22 Jul 2010 12:10:56 +0000 (13:10 +0100)
ews2ical.c

index ac72ee9459e59136ccd3d1c958e37f26fd698012..994be148a99072d803aa8c68332a6b3b903117dd 100644 (file)
@@ -54,6 +54,8 @@ int main(int argc, char **argv)
                return -1;
        }
        read(xmlfd, buf, 1);
+       if (*buf == '<')
+               lseek(xmlfd, 0, SEEK_SET);
        xml_doc = xmlReadFd(xmlfd, "noname.xml", "utf-8", XML_PARSE_RECOVER);
        if (!xml_doc) {
                fprintf(stderr, "Failed to parse XML\n");