diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-05-19 23:45:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-05-19 23:45:45 +0800 |
commit | e8854e97871d49a6136e0d46fd6777166b65d360 (patch) | |
tree | da5df77a5a8d46ceaa92131d39105cf3271e66eb | |
parent | 36c200313fbaf21d2d429ec5e81cf5a3f270cf4e (diff) | |
download | gsoc2013-evolution-e8854e97871d49a6136e0d46fd6777166b65d360.tar.gz gsoc2013-evolution-e8854e97871d49a6136e0d46fd6777166b65d360.tar.zst gsoc2013-evolution-e8854e97871d49a6136e0d46fd6777166b65d360.zip |
** Fixes bug #533465, patch from Ritesh Khadgaray
2008-05-19 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #533465, patch from Ritesh Khadgaray
* mail/em-account-editor.c (emae_url_set_hostport):
Strip whitespace from user-entered hostname.
svn path=/branches/gnome-2-22/; revision=35512
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/em-account-editor.c | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 6a6e312763..6e10f3a3de 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2008-05-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes bug #533465, patch from Ritesh Khadgaray + + * em-account-editor.c (emae_url_set_hostport): + Strip whitespace from user-entered hostname. + 2008-05-19 Srinivasa Ragavan <sragavan@novell.com> * em-folder-view.c: Make non junk learning work again. diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index b41fd7d356..863faacc75 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -1025,15 +1025,18 @@ emae_url_set_hostport(CamelURL *url, const char *txt) /* FIXME: what if this was a raw IPv6 address? */ if (txt && (port = strchr(txt, ':'))) { camel_url_set_port(url, atoi(port+1)); - host = g_alloca(port-txt+1); - memcpy(host, txt, port-txt); + host = g_strdup(txt); host[port-txt] = 0; } else { /* "" is converted to NULL, but if we set NULL on the url, camel_url_to_string strips lots of details */ - host = (char *)(txt?txt:""); + host = g_strdup((txt?txt:"")); } + + g_strstrip(host); camel_url_set_host(url, host); + + g_free(host); } /* This is used to map a funciton which will set on the url a string value. |