Sun, 09 Jun 2024 16:43:40 +0200
fix dav path separator function
application/window.c | file | annotate | diff | comparison | revisions |
--- a/application/window.c Sun Jun 09 16:06:40 2024 +0200 +++ b/application/window.c Sun Jun 09 16:43:40 2024 +0200 @@ -139,12 +139,15 @@ cxstring path = cx_strsubs(fpath, end+skip); cxstring *pathelms; - size_t nelm = cx_strsplit_a(cxDefaultAllocator, path, CX_STR("/"), 4096, &pathelms); - - if (nelm == 0) { - *ret_nelm = 0; - return NULL; - } + size_t nelm = 0; + + if(path.length > 0) { + nelm = cx_strsplit_a(cxDefaultAllocator, path, CX_STR("/"), 4096, &pathelms); + if (nelm == 0) { + *ret_nelm = 0; + return NULL; + } + } UiPathElm* elms = (UiPathElm*)calloc(nelm + 1, sizeof(UiPathElm)); size_t n = nelm + 1;