From 26b82892c72f977aa4602ddef20cca2cc4743e05 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 27 Mar 2001 05:22:08 +0000 Subject: Fix parsing of params. (output_param): And unparsing... * camel-url.c (camel_url_new_with_base): Fix parsing of params. (output_param): And unparsing... svn path=/trunk/; revision=8967 --- camel/camel-url.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'camel/camel-url.c') diff --git a/camel/camel-url.c b/camel/camel-url.c index 2777a3f32a..28f913495d 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -157,10 +157,10 @@ camel_url_new_with_base (CamelURL *base, const char *url_string) eq = memchr (cur, '=', p - cur); if (eq) { name = g_strndup (cur, eq - cur); - value = g_strndup (eq + 1, end - (eq + 1)); + value = g_strndup (eq + 1, p - (eq + 1)); camel_url_decode (value); } else { - name = g_strndup (cur, end - cur); + name = g_strndup (cur, p - cur); value = g_strdup (""); } camel_url_decode (name); @@ -369,6 +369,11 @@ output_param (GQuark key_id, gpointer data, gpointer user_data) enc = camel_url_encode (g_quark_to_string (key_id), FALSE, "?#"); g_string_sprintfa (str, ";%s", enc); g_free (enc); + if (*(char *)data) { + enc = camel_url_encode (data, FALSE, "?#"); + g_string_sprintfa (str, "=%s", enc); + g_free (enc); + } } /** -- cgit