- server = strdup(url + 6);
- if (server == NULL) {
- fprintf(stderr, "Failed to strdup server string\n");
- free_file_context(file_context);
- return NULL;
- }
- if (server[0] == '/' || server[0] == '\0') {
- fprintf(stderr, "Invalid server string.\n");
- free(server);
- free_file_context(file_context);
- return NULL;
- }
- strp = strchr(server, '/');
- path = strdup(strp);
- *strp = 0;
- if (path == NULL) {
- fprintf(stderr, "Invalid URL specified.\n");
- free(server);
+ file_context->url = nfs_parse_url_full(file_context->nfs, url);
+ if (file_context->url == NULL) {
+ fprintf(stderr, "%s\n", nfs_get_error(file_context->nfs));