~ubuntu-branches/ubuntu/maverick/liferea/maverick

« back to all changes in this revision

Viewing changes to src/xml.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2008-06-23 12:44:17 UTC
  • mfrom: (1.2.52 upstream)
  • Revision ID: james.westby@ubuntu.com-20080623124417-o4klc8dom3qwd7wn
Tags: 1.4.16b-0.1ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - Change Build-Depends from xulrunner-dev to xulrunner-1.9-dev.
  - Add intltool to Build-Depends.
  - Fix systray mis-behaviour when Liferea is visible in another workspace.
  - Add Hildonisation from Frothing as a patch.
  - Add libhildon-1-dev Build-Depends for lpia.
  - --enable-maemo when building on lpia.
  - Call intltool-update -p to generate translation template for Rosetta.
  - Do not build transitional packages (not required due to Conflicts/
    Provides/Replaces).
  - Build-depend on liblualib50-dev instead of liblua5.1-0-dev.
  - Do not build webkit package.
  - Munge Maintainer field as per spec.
* Ubuntu changes dropped:
  - mobile.desktop, it isn't needed any more.
  - Added xulrunner-1.9 to liferea dependencies.
  - Quilt changes.
* Edit xulrunner-1.9 patch to not patch configure, handle that in
  99_autoconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
368
368
                va_start (params, msg);
369
369
                newmsg = g_strdup_vprintf (msg, params);
370
370
                va_end (params);
371
 
 
372
 
                g_assert (NULL != newmsg);
373
 
                newmsg = common_utf8_fix (newmsg);
374
 
                tmp = g_markup_escape_text (newmsg, -1);
375
 
                g_free (newmsg);
376
 
                newmsg = tmp;
377
 
        
378
 
                g_string_append_printf(errors->msg, "<pre>%s</pre>\n", newmsg);
 
371
        
 
372
                /* Do never encode any invalid characters from error messages */
 
373
                if (g_utf8_validate (newmsg, -1, NULL)) {
 
374
                        tmp = g_markup_escape_text (newmsg, -1);
 
375
                        g_free (newmsg);
 
376
                        newmsg = tmp;
 
377
        
 
378
                        g_string_append_printf(errors->msg, "<pre>%s</pre>\n", newmsg);
 
379
                }
379
380
                g_free(newmsg);
380
381
        }
381
382
        
510
511
        
511
512
        /* we don't like no data */
512
513
        if (0 == fpc->dataLength) {
513
 
                debug1 (DEBUG_PARSING, "common_parse_xml_feed(): empty input while parsing \"%s\"!", fpc->subscription->node->title);
 
514
                debug1 (DEBUG_PARSING, "xml_parse_feed(): empty input while parsing \"%s\"!", fpc->subscription->node->title);
514
515
                g_string_append (fpc->feed->parseErrors, "Empty input!\n");
515
516
                return NULL;
516
517
        }
518
519
        errors = g_new0 (struct errorCtxt, 1);
519
520
        errors->msg = fpc->feed->parseErrors;
520
521
        
 
522
        if (!g_utf8_validate (fpc->data, -1, NULL)) {
 
523
                /* We never collect invalid encoding error output to avoid getting
 
524
                   nasty characters inside our error buffer, so we issue a simple
 
525
                   warning here */
 
526
                debug1 (DEBUG_PARSING, "xml_parse_feed(): invalid UTF-8 encoding while parsing \"%s\"!", fpc->subscription->node->title);
 
527
                g_string_append_printf (fpc->feed->parseErrors, _("Invalid encoding in feed \"%s\"!"), fpc->subscription->node->title);
 
528
        }
 
529
        
521
530
        fpc->doc = xml_parse (fpc->data, (size_t)fpc->dataLength, fpc->recovery, errors);
522
531
        if (!fpc->doc) {
523
532
                debug1 (DEBUG_PARSING, "xmlReadMemory: could not parse feed \"%s\"!", fpc->subscription->node->title);