80 } |
80 } |
81 |
81 |
82 DavResource* dav_resource_new_full(DavSession *sn, char *parent_path, char *name, char *href) { |
82 DavResource* dav_resource_new_full(DavSession *sn, char *parent_path, char *name, char *href) { |
83 sstr_t n = sstr(name); |
83 sstr_t n = sstr(name); |
84 // the name must not contain path separators |
84 // the name must not contain path separators |
85 if(n.length > 0) { |
85 if(n.length > 0 && href) { |
86 for(int i=0;i<n.length-1;i++) { |
86 for(int i=0;i<n.length-1;i++) { |
87 char c = n.ptr[i]; |
87 char c = n.ptr[i]; |
88 if(c == '/' || c == '\\') { |
88 if(c == '/' || c == '\\') { |
89 n = sstr(util_resource_name(href)); |
89 n = sstr(util_resource_name(href)); |
90 break; |
90 break; |