From: Colin Leroy Date: Tue, 27 Feb 2007 21:38:57 +0000 (+0000) Subject: 2007-02-27 [colin] 2.8.0cvs6 X-Git-Tag: rel_2_9_0~124 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=ada6f41ba8db5c91e44060dd92ce84ec6b0c9c6c 2007-02-27 [colin] 2.8.0cvs6 * src/mainwindow.c * src/common/utils.c * src/common/utils.h Fix '+' in mailto URIs for List-* headers --- diff --git a/ChangeLog b/ChangeLog index 0a34280bb..fedec5f09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-27 [colin] 2.8.0cvs6 + + * src/mainwindow.c + * src/common/utils.c + * src/common/utils.h + Fix '+' in mailto URIs for List-* headers + 2007-02-27 [colin] 2.8.0cvs5 * src/gtk/gtkutils.c diff --git a/PATCHSETS b/PATCHSETS index d75441e14..9e1f0763f 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2398,3 +2398,4 @@ ( cvs diff -u -r 1.59.2.53 -r 1.59.2.54 src/prefs_filtering.c; cvs diff -u -r 1.1.4.33 -r 1.1.4.34 src/prefs_filtering_action.c; cvs diff -u -r 1.43.2.55 -r 1.43.2.56 src/prefs_matcher.c; ) > 2.8.0cvs3.patchset ( cvs diff -u -r 1.149.2.65 -r 1.149.2.66 src/inc.c; ) > 2.8.0cvs4.patchset ( cvs diff -u -r 1.5.2.53 -r 1.5.2.54 src/gtk/gtkutils.c; ) > 2.8.0cvs5.patchset +( cvs diff -u -r 1.274.2.173 -r 1.274.2.174 src/mainwindow.c; cvs diff -u -r 1.36.2.98 -r 1.36.2.99 src/common/utils.c; cvs diff -u -r 1.20.2.44 -r 1.20.2.45 src/common/utils.h; ) > 2.8.0cvs6.patchset diff --git a/configure.ac b/configure.ac index bc0f00e69..1104c9133 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=5 +EXTRA_VERSION=6 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/utils.c b/src/common/utils.c index 7ba2b5280..8a07661ff 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1611,7 +1611,7 @@ gint get_uri_len(const gchar *str) /* Decodes URL-Encoded strings (i.e. strings in which spaces are replaced by * plusses, and escape characters are used) */ -void decode_uri(gchar *decoded_uri, const gchar *encoded_uri) +void decode_uri_with_plus(gchar *decoded_uri, const gchar *encoded_uri, gboolean with_plus) { gchar *dec = decoded_uri; const gchar *enc = encoded_uri; @@ -1626,7 +1626,7 @@ void decode_uri(gchar *decoded_uri, const gchar *encoded_uri) enc += 2; } } else { - if (*enc == '+') + if (with_plus && *enc == '+') *dec = ' '; else *dec = *enc; @@ -1638,6 +1638,11 @@ void decode_uri(gchar *decoded_uri, const gchar *encoded_uri) *dec = '\0'; } +void decode_uri(gchar *decoded_uri, const gchar *encoded_uri) +{ + decode_uri_with_plus(decoded_uri, encoded_uri, TRUE); +} + gint scan_mailto_url(const gchar *mailto, gchar **to, gchar **cc, gchar **bcc, gchar **subject, gchar **body, gchar **attach) { diff --git a/src/common/utils.h b/src/common/utils.h index 2546e2523..65779c101 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -354,6 +354,9 @@ gchar *get_uri_path (const gchar *uri); gint get_uri_len (const gchar *str); void decode_uri (gchar *decoded_uri, const gchar *encoded_uri); +void decode_uri_with_plus (gchar *decoded_uri, + const gchar *encoded_uri, + gboolean with_plus); gint scan_mailto_url (const gchar *mailto, gchar **to, gchar **cc, diff --git a/src/mainwindow.c b/src/mainwindow.c index 895e8ddcf..f0e6b159e 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -2500,7 +2500,8 @@ static void get_url_part (const gchar **buffer, gchar *url_decoded, gint maxlen) const gchar *buf; gint i = 0; buf = *buffer; - + gboolean with_plus = TRUE; + if (buf == 0x00) { *url_decoded = '\0'; *buffer = NULL; @@ -2514,6 +2515,8 @@ static void get_url_part (const gchar **buffer, gchar *url_decoded, gint maxlen) /* First non space and non comment must be a < */ if (*buf =='<' ) { buf++; + if (!strncmp(buf, "mailto:", strlen("mailto:"))) + with_plus = FALSE; for (i = 0; *buf != '>' && *buf != 0x00 && i, ignore space, comments and tabs */