application/window.c

changeset 34
98e041f2f9a2
parent 33
cdeb0dc47ef5
child 36
9f3448a10d11
equal deleted inserted replaced
33:cdeb0dc47ef5 34:98e041f2f9a2
137 cxmutstr base = cx_strdup(cx_strn(full_path, end)); 137 cxmutstr base = cx_strdup(cx_strn(full_path, end));
138 cxmutstr base_path = cx_strdup(cx_strcast(base)); 138 cxmutstr base_path = cx_strdup(cx_strcast(base));
139 cxstring path = cx_strsubs(fpath, end+skip); 139 cxstring path = cx_strsubs(fpath, end+skip);
140 140
141 cxstring *pathelms; 141 cxstring *pathelms;
142 size_t nelm = cx_strsplit_a(cxDefaultAllocator, path, CX_STR("/"), 4096, &pathelms); 142 size_t nelm = 0;
143 143
144 if (nelm == 0) { 144 if(path.length > 0) {
145 *ret_nelm = 0; 145 nelm = cx_strsplit_a(cxDefaultAllocator, path, CX_STR("/"), 4096, &pathelms);
146 return NULL; 146 if (nelm == 0) {
147 } 147 *ret_nelm = 0;
148 return NULL;
149 }
150 }
148 151
149 UiPathElm* elms = (UiPathElm*)calloc(nelm + 1, sizeof(UiPathElm)); 152 UiPathElm* elms = (UiPathElm*)calloc(nelm + 1, sizeof(UiPathElm));
150 size_t n = nelm + 1; 153 size_t n = nelm + 1;
151 elms[0].name = base.ptr; 154 elms[0].name = base.ptr;
152 elms[0].name_len = base.length; 155 elms[0].name_len = base.length;

mercurial