197 free(url.ptr); |
197 free(url.ptr); |
198 } |
198 } |
199 |
199 |
200 char* util_path_to_url(DavSession *sn, char *path) { |
200 char* util_path_to_url(DavSession *sn, char *path) { |
201 char *space = malloc(256); |
201 char *space = malloc(256); |
202 UcxBuffer *url = ucx_buffer_new(space, 256, UCX_BUFFER_AUTOEXTEND); |
202 UcxBuffer *url = ucx_buffer_new(space, 256, CX_BUFFER_AUTO_EXTEND); |
203 |
203 |
204 // add base url |
204 // add base url |
205 ucx_buffer_write(sn->base_url, 1, strlen(sn->base_url), url); |
205 ucx_buffer_write(sn->base_url, 1, strlen(sn->base_url), url); |
206 // remove trailing slash |
206 // remove trailing slash |
207 ucx_buffer_seek(url, -1, SEEK_CUR); |
207 ucx_buffer_seek(url, -1, SEEK_CUR); |