summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-12-29 00:47:26 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-12-29 00:47:26 +0200
commit426df179766b4b144cf746dfc56f4b4a9f80b3ac (patch)
treea249d2c6711b163b425e9eca503be4eec4be3421
parent43508b4588ff631efbb22ee3cb84a802358b5e44 (diff)
downloadmailutils-426df179766b4b144cf746dfc56f4b4a9f80b3ac.tar.gz
mailutils-426df179766b4b144cf746dfc56f4b4a9f80b3ac.tar.bz2
Bugfixes.
* libmailutils/url/create.c (_mu_url_create_internal): Fix parsing of the '|' shortcuts. * libmailutils/tests/url.at: Fix '|' test. Add 'prog://' test. * movemail/movemail.c (set_program_id): Call mu_stdstream_strerr_setup to flush changes. * frm/common.c: Minor changes
-rw-r--r--frm/common.c14
-rw-r--r--libmailutils/tests/url.at18
-rw-r--r--libmailutils/url/create.c19
-rw-r--r--movemail/movemail.c1
4 files changed, 34 insertions, 18 deletions
diff --git a/frm/common.c b/frm/common.c
index 336343270..4fea29cec 100644
--- a/frm/common.c
+++ b/frm/common.c
@@ -388,19 +388,15 @@ get_personal (mu_header_t hdr, const char *field, char **personal)
if (status == 0)
{
mu_address_t address = NULL;
- char *s = NULL;
+ const char *s = NULL;
mu_address_create (&address, hfield);
- mu_address_aget_personal (address, 1, &s);
- mu_address_destroy (&address);
+ mu_address_sget_personal (address, 1, &s);
if (s == NULL)
s = hfield;
- else
- free (hfield);
-
*personal = rfc2047_decode_wrapper (s, strlen (s));
- free (s);
+ mu_address_destroy (&address);
}
return status;
}
@@ -483,7 +479,7 @@ action (mu_observer_t o, size_t type, void *data, void *action_data)
format_field ("");
status = mu_header_aget_value_unfold (hdr, MU_HEADER_SUBJECT,
- &tmp);
+ &tmp);
if (status == 0)
{
char *s = rfc2047_decode_wrapper (tmp, strlen (tmp));
@@ -581,7 +577,7 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
status = mu_mailbox_scan (mbox, 1, total);
if (status != 0)
{
- mu_error (_("could not scan mailbox `%s': %s."),
+ mu_error (_("could not scan mailbox `%s': %s"),
mu_url_to_string (url), mu_strerror (status));
frm_abort (&mbox);
}
diff --git a/libmailutils/tests/url.at b/libmailutils/tests/url.at
index 9f933eaa9..f24fa7786 100644
--- a/libmailutils/tests/url.at
+++ b/libmailutils/tests/url.at
@@ -804,9 +804,21 @@ auth <>
host <>
port 0
path </bin/mailman>
-query[0] </bin/mailman>
-query[1] <request>
-query[2] <list%40dom>
+query[0] <request>
+query[1] <list%40dom>
+]])
+
+TESTURL([],[],
+[prog:///bin/mailman?request&list%40dom],
+[[scheme <prog>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </bin/mailman>
+query[0] <request>
+query[1] <list@dom>
]])
m4_popdef([TESTURL])
diff --git a/libmailutils/url/create.c b/libmailutils/url/create.c
index 0d0cb304d..bddc7cc78 100644
--- a/libmailutils/url/create.c
+++ b/libmailutils/url/create.c
@@ -378,6 +378,7 @@ _mu_url_create_internal (struct mu_url_ctx *ctx, mu_url_t hint)
if ((ctx->flags & MU_URL_PARSE_PIPE) && ctx->input[0] == '|')
{
struct mu_wordsplit ws;
+ size_t i;
rc = str_assign (&url->scheme, "prog");
if (rc)
@@ -386,15 +387,21 @@ _mu_url_create_internal (struct mu_url_ctx *ctx, mu_url_t hint)
ctx->flags &= ~MU_URL_PARSE_HEXCODE;
if (mu_wordsplit (ctx->input + 1, &ws, MU_WRDSF_DEFFLAGS))
return errno;
- url->qargc = ws.ws_wordc;
- url->qargv = ws.ws_wordv;
+ url->path = ws.ws_wordv[0];
+ url->flags |= MU_URL_PATH;
+
+ url->qargc = ws.ws_wordc - 1;
+ url->qargv = calloc (url->qargc + 1, sizeof (url->qargv[0]));
+ if (!url->qargv)
+ {
+ mu_wordsplit_free (&ws);
+ return ENOMEM;
+ }
+ for (i = 0; i < url->qargc; i++)
+ url->qargv[i] = ws.ws_wordv[i+1];
ws.ws_wordc = 0;
- ws.ws_wordv = NULL;
mu_wordsplit_free (&ws);
url->flags |= MU_URL_QUERY;
- rc = str_assign (&url->path, url->qargv[0]);
- if (rc == 0)
- url->flags |= MU_URL_PATH;
}
else if ((ctx->flags & MU_URL_PARSE_SLASH) && ctx->input[0] == '/')
{
diff --git a/movemail/movemail.c b/movemail/movemail.c
index 9a0133fc4..13e71c48c 100644
--- a/movemail/movemail.c
+++ b/movemail/movemail.c
@@ -828,6 +828,7 @@ set_program_id (const char *source_name, const char *dest_name)
ws.ws_wordv[0] = NULL;
ws.ws_wordc = 0;
mu_wordsplit_free (&ws);
+ mu_stdstream_strerr_setup (MU_STRERR_STDERR);
}

Return to:

Send suggestions and report system problems to the System administrator.