aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-html-utils.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-10-23 02:46:46 +0800
committerDan Winship <danw@src.gnome.org>2001-10-23 02:46:46 +0800
commit44faa44bffd7fae58fa58e9eebda4b3244d025f8 (patch)
treed54d2dfd8a2caa8616a35960af1d979008f8936d /e-util/e-html-utils.c
parent708dc70ac5b5cf2711a1f43293a9e0a4467adcb7 (diff)
downloadgsoc2013-evolution-44faa44bffd7fae58fa58e9eebda4b3244d025f8.tar.gz
gsoc2013-evolution-44faa44bffd7fae58fa58e9eebda4b3244d025f8.tar.zst
gsoc2013-evolution-44faa44bffd7fae58fa58e9eebda4b3244d025f8.zip
Pass a CORBA_Environment to bonobo_config_get_string so it doesn't g_warn
* e-passwords.c (e_passwords_get_password): Pass a CORBA_Environment to bonobo_config_get_string so it doesn't g_warn on error. (Since the "error" is most likely just that the password isn't cached.) (e_passwords_remember_password, e_passwords_get_password, e_passwords_add_password): Change "if (foo) { entire function; }" to "if (!foo) return;" * e-html-utils.c (special_chars): Don't allow single quote or backtick in email addresses, or pipes following URLs. svn path=/trunk/; revision=13887
Diffstat (limited to 'e-util/e-html-utils.c')
-rw-r--r--e-util/e-html-utils.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c
index a2759f91a8..c9e61a5372 100644
--- a/e-util/e-html-utils.c
+++ b/e-util/e-html-utils.c
@@ -40,21 +40,20 @@ check_size (char **buffer, int *buffer_size, char *out, int len)
return out;
}
-/* 1 = non-email-address chars: ()<>@,;:\"[] */
-/* 2 = trailing garbage: ,.!?;:>)]}`'-_ */
+/* 1 = non-email-address chars: ()<>@,;:\"[]`'| */
+/* 2 = trailing url garbage: ,.!?;:>)]}`'-_| */
static int special_chars[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* nul - 0x0f */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */
- 1, 2, 1, 0, 0, 0, 0, 2, 1, 3, 0, 0, 3, 2, 2, 0, /* sp - / */
+ 1, 2, 1, 0, 0, 0, 0, 3, 1, 3, 0, 0, 3, 2, 2, 0, /* sp - / */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 0, 3, 2, /* 0 - ? */
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ - O */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0, 2, /* P - _ */
- 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ` - o */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0 /* p - del */
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ` - o */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0 /* p - del */
};
#define is_addr_char(c) (isprint (c) && !(special_chars[c] & 1))
-#define is_addr_char_no_pipes(c) (is_addr_char(c) && (c) != '|')
#define is_trailing_garbage(c) (!isprint(c) || (special_chars[c] & 2))
static char *
@@ -89,13 +88,13 @@ email_address_extract (const unsigned char **cur, char **out, const unsigned cha
char *addr;
/* *cur points to the '@'. Look backward for a valid local-part */
- for (start = *cur; start - 1 >= linestart && is_addr_char_no_pipes (*(start - 1)); start--)
+ for (start = *cur; start - 1 >= linestart && is_addr_char (*(start - 1)); start--)
;
if (start == *cur)
return NULL;
/* Now look forward for a valid domain part */
- for (end = *cur + 1, dot = NULL; is_addr_char_no_pipes (*end); end++) {
+ for (end = *cur + 1, dot = NULL; is_addr_char (*end); end++) {
if (*end == '.' && !dot)
dot = end;
}