summaryrefslogtreecommitdiff
path: root/libmailutils/url/create.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-10-28 13:21:25 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-10-28 13:21:25 +0300
commit02334735e86f1cfda6a2e07cfea9283e4fc88011 (patch)
tree913b14a24eb171561141741b7b3c4f93105bcaa9 /libmailutils/url/create.c
parente9a329bfe70d903fb0a78007adaff6b565ddfc6b (diff)
downloadmailutils-02334735e86f1cfda6a2e07cfea9283e4fc88011.tar.gz
mailutils-02334735e86f1cfda6a2e07cfea9283e4fc88011.tar.bz2
New interface for composing URLs from parts.
* include/mailutils/url.h (mu_url_sget_name) (mu_url_aget_name,mu_url_get_name) (mu_url_invalidate,mu_url_create_null) (mu_url_set_user,mu_url_set_path,mu_url_set_scheme) (mu_url_set_host,mu_url_set_port,mu_url_set_service) (mu_url_set_auth,mu_url_set_secret,mu_url_add_param) (mu_url_clear_param,mu_url_add_query,mu_url_clear_query): New prototypes. * libmailutils/tests/url-comp.at: New test case. * libmailutils/tests/url-comp.c: New test program. * libmailutils/tests/.gitignore: Update. * libmailutils/tests/Makefile.am: Add new files. * libmailutils/tests/testsuite.at: Add new tests. * libmailutils/url/Makefile.am: Add new files. * libmailutils/url/add-param.c: New file. * libmailutils/url/add-query.c: New file. * libmailutils/url/clr-param.c: New file. * libmailutils/url/clr-query.c: New file. * libmailutils/url/null.c: New file. * libmailutils/url/set-auth.c: New file. * libmailutils/url/set-host.c: New file. * libmailutils/url/set-path.c: New file. * libmailutils/url/set-port.c: New file. * libmailutils/url/set-scheme.c: New file. * libmailutils/url/set-secret.c: New file. * libmailutils/url/set-service.c: New file. * libmailutils/url/set-user.c: New file. * libmailutils/url/urlinv.c: New file. * libmailutils/url/create.c (mu_url_create_hint): Return EINVAL if purl is NULL. * libmailutils/url/scheme.c (mu_url_set_scheme): Remove. See set-scheme.c * libmailutils/url/urlstr.c (mu_url_sget_name) (mu_url_aget_name,mu_url_get_name): New functions. (mu_url_to_string): Rewrite using the above. * libmailutils/base/Makefile.am: Add fscompose.c * libmailutils/base/fscompose.c: New file.
Diffstat (limited to 'libmailutils/url/create.c')
-rw-r--r--libmailutils/url/create.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libmailutils/url/create.c b/libmailutils/url/create.c
index 130b7a2bc..d6b01be2c 100644
--- a/libmailutils/url/create.c
+++ b/libmailutils/url/create.c
@@ -532,7 +532,11 @@ mu_url_create_hint (mu_url_t *purl, const char *str, int flags,
{
int rc;
struct mu_url_ctx ctx;
- mu_url_t url = calloc (1, sizeof (*url));
+ mu_url_t url;
+
+ if (!purl)
+ return EINVAL;
+ url = calloc (1, sizeof (*url));
if (url == NULL)
return ENOMEM;
url->name = strdup (str);

Return to:

Send suggestions and report system problems to the System administrator.