url->port = NULL;
url->host = talloc_strndup(url, p, path - p);
}
+
+ /* remove multiple leading slashes */
+ for (; *path && *(path+1) == '/'; path++)
+ ;
+
url->path = talloc_strdup(url, path);
}
talloc_free(url);
return NULL;
}
+
+const char *pb_url_scheme_name(enum pb_url_scheme scheme)
+{
+ unsigned int i;
+
+ for (i = 0; i < sizeof(schemes) / sizeof(schemes[0]); i++)
+ if (schemes[i].scheme == scheme)
+ return schemes[i].str;
+
+ return NULL;
+}