libidav/utils.c

branch
dav-2
changeset 894
e86049631677
parent 893
38800d479cd4
equal deleted inserted replaced
893:38800d479cd4 894:e86049631677
741 } 741 }
742 } 742 }
743 743
744 cxmutstr url; 744 cxmutstr url;
745 if(add_separator) { 745 if(add_separator) {
746 url = cx_strcat(3, base, cx_str("/"), path); 746 url = cx_strcat(CX_NULLSTR, 3, base, cx_str("/"), path);
747 } else { 747 } else {
748 url = cx_strcat(2, base, path); 748 url = cx_strcat(CX_NULLSTR, 2, base, path);
749 } 749 }
750 750
751 return url; 751 return url;
752 } 752 }
753 753
767 } 767 }
768 } 768 }
769 769
770 cxmutstr url; 770 cxmutstr url;
771 if(add_separator) { 771 if(add_separator) {
772 url = cx_strcat(3, base, cx_strn(&separator, 1), path); 772 url = cx_strcat(CX_NULLSTR, 3, base, cx_strn(&separator, 1), path);
773 } else { 773 } else {
774 url = cx_strcat(2, base, path); 774 url = cx_strcat(CX_NULLSTR, 2, base, path);
775 } 775 }
776 776
777 return url; 777 return url;
778 } 778 }
779 779
790 cxstring href_str = cx_str(href); 790 cxstring href_str = cx_str(href);
791 791
792 const char *base_path = util_url_path(sn->base_url); 792 const char *base_path = util_url_path(sn->base_url);
793 base.length -= strlen(base_path); 793 base.length -= strlen(base_path);
794 794
795 cxmutstr url = cx_strcat(2, base, href_str); 795 cxmutstr url = cx_strcat(CX_NULLSTR, 2, base, href_str);
796 return url.ptr; 796 return url.ptr;
797 } 797 }
798 798
799 void util_set_url(DavSession *sn, const char *href) { 799 void util_set_url(DavSession *sn, const char *href) {
800 char *url = util_get_url(sn, href); 800 char *url = util_get_url(sn, href);

mercurial