X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=lib%2Furl%2Furl.c;h=700f87cd936ed0d184cb75312f6cacac0c1739bf;hp=6d1004f7f806d2ac6e94cfd9e265be4446eee852;hb=52bec18801b226b57f53d9f075addd2c07caa3db;hpb=a5db3ced87f5f24500f785b70af8b8630bc1c077 diff --git a/lib/url/url.c b/lib/url/url.c index 6d1004f..700f87c 100644 --- a/lib/url/url.c +++ b/lib/url/url.c @@ -22,7 +22,6 @@ #define _GNU_SOURCE #include -#include #include #include "log/log.h" @@ -228,7 +227,7 @@ fail: return NULL; } -static bool is_url(const char *str) +bool is_url(const char *str) { return strstr(str, "://") != NULL; } @@ -254,13 +253,13 @@ static struct pb_url *pb_url_copy(void *ctx, const struct pb_url *url) new_url = talloc(ctx, struct pb_url); new_url->scheme = url->scheme; - new_url->full = talloc_strdup(url, url->full); + new_url->full = talloc_strdup(new_url, url->full); - new_url->host = url->host ? talloc_strdup(url, url->host) : NULL; - new_url->port = url->port ? talloc_strdup(url, url->port) : NULL; - new_url->path = url->path ? talloc_strdup(url, url->path) : NULL; - new_url->dir = url->dir ? talloc_strdup(url, url->dir) : NULL; - new_url->file = url->file ? talloc_strdup(url, url->file) : NULL; + new_url->host = url->host ? talloc_strdup(new_url, url->host) : NULL; + new_url->port = url->port ? talloc_strdup(new_url, url->port) : NULL; + new_url->path = url->path ? talloc_strdup(new_url, url->path) : NULL; + new_url->dir = url->dir ? talloc_strdup(new_url, url->dir) : NULL; + new_url->file = url->file ? talloc_strdup(new_url, url->file) : NULL; return new_url; }