~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to camel/camel-html-parser.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
459
459
        p->attr = 0;
460
460
        p->attrs = g_ptr_array_new ();
461
461
        p->values = g_ptr_array_new ();
462
 
        p->tag = g_string_new("");
463
 
        p->ent = g_string_new("");
 
462
        p->tag = g_string_new ("");
 
463
        p->ent = g_string_new ("");
464
464
        p->charset = NULL;
465
465
 
466
466
        if (entities == NULL)
505
505
{
506
506
        gint i;
507
507
 
508
 
        printf("got tag: %s\n", p->tag->str);
509
 
        printf("%d attributes:\n", p->attr);
 
508
        printf ("got tag: %s\n", p->tag->str);
 
509
        printf ("%d attributes:\n", p->attr);
510
510
        for (i = 0; i < p->attr; i++) {
511
 
                printf(" %s = '%s'\n", ((GString *)p->attrs->pdata[i])->str, ((GString *)p->values->pdata[i])->str);
 
511
                printf (" %s = '%s'\n", ((GString *) p->attrs->pdata[i])->str, ((GString *) p->values->pdata[i])->str);
512
512
        }
513
513
}
514
514
#endif
521
521
        gint state = p->state, ret, len;
522
522
        gchar *start = p->inptr;
523
523
 
524
 
        d(printf("Tokenise step\n"));
 
524
        d (printf ("Tokenise step\n"));
525
525
 
526
526
        while (in < inend) {
527
527
                c = *in++;
532
532
                                state = CAMEL_HTML_PARSER_TAG;
533
533
                                p->attr = 0;
534
534
                                g_string_truncate (p->tag, 0);
535
 
                                d(printf("got data '%.*s'\n", in-start-1, start));
 
535
                                d (printf ("got data '%.*s'\n", in - start - 1, start));
536
536
                                *datap = start;
537
537
                                *lenp = in-start-1;
538
538
                                goto done;
541
541
                                state = CAMEL_HTML_PARSER_ENT;
542
542
                                g_string_truncate (p->ent, 0);
543
543
                                g_string_append_c (p->ent, c);
544
 
                                d(printf("got data '%.*s'\n", in-start-1, start));
 
544
                                d (printf ("got data '%.*s'\n", in - start - 1, start));
545
545
                                *datap = start;
546
546
                                *lenp = in-start-1;
547
547
                                goto done;
558
558
                                        *lenp = p->ent->len;
559
559
                                        goto done;
560
560
                                } else {
561
 
                                        d(printf("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
 
561
                                        d (printf ("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
562
562
                                        ret = state;
563
563
                                        state = CAMEL_HTML_PARSER_DATA;
564
564
                                        *datap = p->ent_utf8;
637
637
                        } else if (c == ' ' || c == '\n' || c == '\t') {
638
638
                        } else {
639
639
                                if (p->attrs->len <= p->attr) {
640
 
                                        g_ptr_array_add(p->attrs, g_string_new(""));
641
 
                                        g_ptr_array_add(p->values, g_string_new(""));
 
640
                                        g_ptr_array_add (p->attrs, g_string_new (""));
 
641
                                        g_ptr_array_add (p->values, g_string_new (""));
642
642
                                } else {
643
643
                                        g_string_truncate (p->attrs->pdata[p->attr], 0);
644
644
                                        g_string_truncate (p->values->pdata[p->attr], 0);
664
664
                        break;
665
665
                case CAMEL_HTML_PARSER_VAL0:
666
666
                        if (c == '>') {
667
 
                                d(printf("value truncated\n"));
 
667
                                d (printf ("value truncated\n"));
668
668
                                d (dump_tag (p));
669
669
                                ret = CAMEL_HTML_PARSER_ELEMENT;
670
670
                                state = CAMEL_HTML_PARSER_DATA;
683
683
                do_val:
684
684
                        if (p->quote) {
685
685
                                if (c == '>') {
686
 
                                        d(printf("value truncated\n"));
 
686
                                        d (printf ("value truncated\n"));
687
687
                                        d (dump_tag (p));
688
688
                                        ret = CAMEL_HTML_PARSER_ELEMENT;
689
689
                                        state = CAMEL_HTML_PARSER_DATA;
723
723
                                        g_string_append (p->values->pdata[p->attr], p->ent->str);
724
724
                                        g_string_append_c (p->values->pdata[p->attr], ';');
725
725
                                } else {
726
 
                                        d(printf("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
 
726
                                        d (printf ("got entity: %s = %s\n", p->ent->str, p->ent_utf8));
727
727
                                        g_string_append_len (p->values->pdata[p->attr], p->ent_utf8, len);
728
728
                                }
729
729
                        } else if (isalnum (c) || c=='#') { /* FIXME: right type */