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

« back to all changes in this revision

Viewing changes to camel/camel-mime-filter-tohtml.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:
170
170
                u = camel_utf8_getc_limit (&inptr, inend);
171
171
                switch (u) {
172
172
                case 0xffff:
173
 
                        g_warning("Truncated utf8 buffer");
 
173
                        g_warning ("Truncated utf8 buffer");
174
174
                        return outptr;
175
175
                case '<':
176
176
                        outptr = g_stpcpy (outptr, "&lt;");
213
213
                                if (priv->flags & CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT)
214
214
                                        *outptr++ = '?';
215
215
                                else
216
 
                                        outptr += sprintf(outptr, "&#%u;", u);
 
216
                                        outptr += sprintf (outptr, "&#%u;", u);
217
217
                        }
218
218
                        priv->column++;
219
219
                        break;
290
290
                                /* FIXME: we could easily support multiple color depths here */
291
291
 
292
292
                                outptr = check_size (mime_filter, outptr, &outend, 25);
293
 
                                outptr += sprintf(outptr, "<font color=\"#%06x\">", (priv->color & 0xffffff));
 
293
                                outptr += sprintf (outptr, "<font color=\"#%06x\">", (priv->color & 0xffffff));
294
294
                        }
295
295
#if FOOLISHLY_UNMUNGE_FROM
296
296
                        else if (*start == '>') {
314
314
                        do {
315
315
                                if (camel_url_scanner_scan (priv->scanner, start, len - (len > 0 && start[len - 1] == 0 ? 1 : 0), &match)) {
316
316
                                        /* write out anything before the first regex match */
317
 
                                        outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) start + match.um_so,
318
 
                                                          outptr, &outend);
 
317
                                        outptr = writeln (
 
318
                                                mime_filter,
 
319
                                                (const guchar *) start,
 
320
                                                (const guchar *) start +
 
321
                                                match.um_so,
 
322
                                                outptr, &outend);
319
323
 
320
324
                                        start += match.um_so;
321
325
                                        len -= match.um_so;
325
329
                                        /* write out the href tag */
326
330
                                        outptr = append_string_verbatim (mime_filter, "<a href=\"", outptr, &outend);
327
331
                                        /* prefix shouldn't need escaping, but let's be safe */
328
 
                                        outptr = writeln (mime_filter,
329
 
                                                        (const guchar *) match.prefix,
330
 
                                                        (const guchar *) match.prefix + strlen (match.prefix),
331
 
                                                        outptr, &outend);
332
 
                                        outptr = writeln (mime_filter,
333
 
                                                        (const guchar *) start,
334
 
                                                        (const guchar *) start + matchlen,
335
 
                                                        outptr, &outend);
336
 
                                        outptr = append_string_verbatim (mime_filter, "\">", outptr, &outend);
 
332
                                        outptr = writeln (
 
333
                                                mime_filter,
 
334
                                                (const guchar *) match.prefix,
 
335
                                                (const guchar *) match.prefix +
 
336
                                                strlen (match.prefix),
 
337
                                                outptr, &outend);
 
338
                                        outptr = writeln (
 
339
                                                mime_filter,
 
340
                                                (const guchar *) start,
 
341
                                                (const guchar *) start +
 
342
                                                matchlen,
 
343
                                                outptr, &outend);
 
344
                                        outptr = append_string_verbatim (
 
345
                                                mime_filter, "\">",
 
346
                                                outptr, &outend);
337
347
 
338
348
                                        /* now write the matched string */
339
 
                                        outptr = writeln (mime_filter,
340
 
                                                        (const guchar *) start,
341
 
                                                        (const guchar *) start + matchlen,
342
 
                                                        outptr, &outend);
 
349
                                        outptr = writeln (
 
350
                                                mime_filter,
 
351
                                                (const guchar *) start,
 
352
                                                (const guchar *) start +
 
353
                                                matchlen,
 
354
                                                outptr, &outend);
343
355
                                        priv->column += matchlen;
344
356
                                        start += matchlen;
345
357
                                        len -= matchlen;
346
358
 
347
359
                                        /* close the href tag */
348
 
                                        outptr = append_string_verbatim (mime_filter, "</a>", outptr, &outend);
 
360
                                        outptr = append_string_verbatim (
 
361
                                                mime_filter, "</a>",
 
362
                                                outptr, &outend);
349
363
                                } else {
350
364
                                        /* nothing matched so write out the remainder of this line buffer */
351
 
                                        outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) start + len, outptr, &outend);
 
365
                                        outptr = writeln (
 
366
                                                mime_filter,
 
367
                                                (const guchar *) start,
 
368
                                                (const guchar *) start + len,
 
369
                                                outptr, &outend);
352
370
                                        break;
353
371
                                }
354
372
                        } while (len > 0);
355
373
                } else {
356
 
                        outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) inptr, outptr, &outend);
 
374
                        outptr = writeln (
 
375
                                mime_filter,
 
376
                                (const guchar *) start,
 
377
                                (const guchar *) inptr,
 
378
                                outptr, &outend);
357
379
                }
358
380
 
359
381
                if ((priv->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) && depth > 0) {
526
548
 
527
549
        filter = camel_mime_filter_tohtml_new (flags, color);
528
550
 
529
 
        camel_mime_filter_complete (filter, (gchar *) in, strlen (in), 0,
530
 
                                    &outbuf, &outlen, &outpre);
 
551
        camel_mime_filter_complete (
 
552
                filter, (gchar *) in, strlen (in), 0,
 
553
                &outbuf, &outlen, &outpre);
531
554
 
532
555
        outbuf = g_strndup (outbuf, outlen);
533
556