aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-html-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-12 20:02:18 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-20 02:17:55 +0800
commitc85109fc322137596bf34cffc5445d568223c60d (patch)
tree711e6d5b2eb3d6c7780d1d01e20d980c67a77f9e /e-util/e-html-utils.c
parent7d1751cc26a75166019917ec8c3b35e1083d27d6 (diff)
downloadgsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.gz
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.zst
gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'e-util/e-html-utils.c')
-rw-r--r--e-util/e-html-utils.c51
1 files changed, 27 insertions, 24 deletions
diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c
index 3a863da096..5e4de66b93 100644
--- a/e-util/e-html-utils.c
+++ b/e-util/e-html-utils.c
@@ -158,7 +158,7 @@ is_citation (const guchar *c,
/* A line that starts with a ">" is a citation, unless it's
* just mbox From-mangling...
*/
- if (strncmp ((const gchar *)c, ">From ", 6) != 0)
+ if (strncmp ((const gchar *) c, ">From ", 6) != 0)
return TRUE;
/* If the previous line was a citation, then say this
@@ -281,36 +281,37 @@ e_text_to_html_full (const gchar *input,
(flags & E_TEXT_TO_HTML_CONVERT_URLS)) {
gchar *tmpurl = NULL, *refurl = NULL, *dispurl = NULL;
- if (!g_ascii_strncasecmp ((gchar *)cur, "http://", 7) ||
- !g_ascii_strncasecmp ((gchar *)cur, "https://", 8) ||
- !g_ascii_strncasecmp ((gchar *)cur, "ftp://", 6) ||
- !g_ascii_strncasecmp ((gchar *)cur, "nntp://", 7) ||
- !g_ascii_strncasecmp ((gchar *)cur, "mailto:", 7) ||
- !g_ascii_strncasecmp ((gchar *)cur, "news:", 5) ||
- !g_ascii_strncasecmp ((gchar *)cur, "file:", 5) ||
- !g_ascii_strncasecmp ((gchar *)cur, "callto:", 7) ||
- !g_ascii_strncasecmp ((gchar *)cur, "h323:", 5) ||
- !g_ascii_strncasecmp ((gchar *)cur, "sip:", 4) ||
- !g_ascii_strncasecmp ((gchar *)cur, "webcal:", 7)) {
+ if (!g_ascii_strncasecmp ((gchar *) cur, "http://", 7) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "https://", 8) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "ftp://", 6) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "nntp://", 7) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "mailto:", 7) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "news:", 5) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "file:", 5) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "callto:", 7) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "h323:", 5) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "sip:", 4) ||
+ !g_ascii_strncasecmp ((gchar *) cur, "webcal:", 7)) {
tmpurl = url_extract (&cur, TRUE);
if (tmpurl) {
refurl = e_text_to_html (tmpurl, 0);
dispurl = g_strdup (refurl);
}
- } else if (!g_ascii_strncasecmp ((gchar *)cur, "www.", 4) &&
+ } else if (!g_ascii_strncasecmp ((gchar *) cur, "www.", 4) &&
is_url_char (*(cur + 4))) {
tmpurl = url_extract (&cur, FALSE);
if (tmpurl) {
dispurl = e_text_to_html (tmpurl, 0);
- refurl = g_strdup_printf ("http://%s",
- dispurl);
+ refurl = g_strdup_printf (
+ "http://%s", dispurl);
}
}
if (tmpurl) {
- out = check_size (&buffer, &buffer_size, out,
- strlen (refurl) +
- strlen (dispurl) + 15);
+ out = check_size (
+ &buffer, &buffer_size, out,
+ strlen (refurl) +
+ strlen (dispurl) + 15);
out += sprintf (out,
"<a href=\"%s\">%s</a>",
refurl, dispurl);
@@ -331,8 +332,9 @@ e_text_to_html_full (const gchar *input,
addr = email_address_extract (&cur, &out, linestart);
if (addr) {
dispaddr = e_text_to_html (addr, 0);
- outaddr = g_strdup_printf ("<a href=\"mailto:%s\">%s</a>",
- addr, dispaddr);
+ outaddr = g_strdup_printf (
+ "<a href=\"mailto:%s\">%s</a>",
+ addr, dispaddr);
out = check_size (&buffer, &buffer_size, out, strlen (outaddr));
out += sprintf (out, "%s", outaddr);
col += strlen (addr);
@@ -396,8 +398,8 @@ e_text_to_html_full (const gchar *input,
if (flags & (E_TEXT_TO_HTML_CONVERT_SPACES |
E_TEXT_TO_HTML_CONVERT_NL)) {
do {
- out = check_size (&buffer, &buffer_size,
- out, 7);
+ out = check_size (
+ &buffer, &buffer_size, out, 7);
strcpy (out, "&nbsp;");
out += 6;
col++;
@@ -428,7 +430,7 @@ e_text_to_html_full (const gchar *input,
if (flags & E_TEXT_TO_HTML_ESCAPE_8BIT)
*out++ = '?';
else
- out += g_snprintf(out, 9, "&#%d;", u);
+ out += g_snprintf (out, 9, "&#%d;", u);
}
col++;
break;
@@ -541,7 +543,8 @@ main (gint argc,
if ((url && (!url_tests[i].url || strcmp (url, url_tests[i].url) != 0)) ||
(!url && url_tests[i].url)) {
- printf ("FAILED on \"%s\" -> %s\n (got %s)\n\n",
+ printf (
+ "FAILED on \"%s\" -> %s\n (got %s)\n\n",
url_tests[i].text,
url_tests[i].url ? url_tests[i].url : "(nothing)",
url ? url : "(nothing)");