application/window.c

changeset 118
6d0da97105d8
parent 117
b174e721663e
equal deleted inserted replaced
117:b174e721663e 118:6d0da97105d8
406 skip++; // skip first '/' 406 skip++; // skip first '/'
407 } 407 }
408 408
409 409
410 cxmutstr base = cx_strdup(cx_strn(full_path, end)); 410 cxmutstr base = cx_strdup(cx_strn(full_path, end));
411 cxmutstr base_path = cx_strcat(2, cx_strcast(base), cx_str("/")); 411 cxmutstr base_path = cx_strcat(CX_NULLSTR, 2, base, cx_str("/"));
412 cxstring path = cx_strsubs(fpath, end + skip); 412 cxstring path = cx_strsubs(fpath, end + skip);
413 413
414 cxstring trail = cx_str(len > 0 && full_path[len-1] == '/' ? "/" : ""); 414 cxstring trail = cx_str(len > 0 && full_path[len-1] == '/' ? "/" : "");
415 415
416 cxstring *pathelms; 416 cxstring *pathelms;
446 cxmutstr m = cx_strdup(c); 446 cxmutstr m = cx_strdup(c);
447 elms[j].name = m.ptr; 447 elms[j].name = m.ptr;
448 elms[j].name_len = m.length; 448 elms[j].name_len = m.length;
449 449
450 size_t elm_path_len = c.ptr + c.length - full_path; 450 size_t elm_path_len = c.ptr + c.length - full_path;
451 cxmutstr elm_path = cx_strcat(2, cx_strn(full_path, elm_path_len), i+1 < nelm ? cx_str("/") : trail); 451 cxmutstr elm_path = cx_strcat(CX_NULLSTR, 2, cx_strn(full_path, elm_path_len), i+1 < nelm ? cx_str("/") : trail);
452 elms[j].path = elm_path.ptr; 452 elms[j].path = elm_path.ptr;
453 elms[j].path_len = elm_path.length; 453 elms[j].path_len = elm_path.length;
454 454
455 j++; 455 j++;
456 } 456 }

mercurial