aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libpies.h1
-rw-r--r--lib/url.c19
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/libpies.h b/lib/libpies.h
index b04182e..1c83b8e 100644
--- a/lib/libpies.h
+++ b/lib/libpies.h
@@ -71,6 +71,7 @@ struct pies_url
char **argv;
};
+int pies_basic_url_create (struct pies_url **purl, const char *str);
int pies_url_create (struct pies_url **purl, const char *str);
void pies_url_destroy (struct pies_url **purl);
const char *pies_url_get_arg (struct pies_url *url, const char *argname);
diff --git a/lib/url.c b/lib/url.c
index 41f5c04..11d220d 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -325,7 +325,7 @@ pies_url_copy (struct pies_url **purl, struct pies_url *src)
}
int
-pies_url_create (struct pies_url **purl, const char *str)
+pies_basic_url_create (struct pies_url **purl, const char *str)
{
int rc;
struct pies_url *url;
@@ -344,6 +344,23 @@ pies_url_create (struct pies_url **purl, const char *str)
}
return rc;
}
+
+extern char **environ;
+
+int
+pies_url_create (struct pies_url **purl, const char *str)
+{
+ struct wordsplit ws;
+ int rc;
+
+ ws.ws_env = (const char**) environ;
+ if (wordsplit (str, &ws,
+ WRDSF_NOCMD | WRDSF_QUOTE | WRDSF_NOSPLIT | WRDSF_ENV))
+ return -1;
+ rc = pies_basic_url_create (purl, ws.ws_wordv[0]);
+ wordsplit_free (&ws);
+ return rc;
+}
const char *
pies_url_get_arg (struct pies_url *url, const char *argname)

Return to:

Send suggestions and report system problems to the System administrator.