application/config.c

changeset 117
b174e721663e
parent 114
3da24640513a
--- a/application/config.c	Wed Dec 17 22:36:41 2025 +0100
+++ b/application/config.c	Sat Dec 27 22:47:56 2025 +0100
@@ -111,7 +111,7 @@
     }
     
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 1024, cxDefaultAllocator, CX_BUFFER_AUTO_EXTEND);
+    cxBufferInit(&buf, cxDefaultAllocator, NULL, 1024, CX_BUFFER_AUTO_EXTEND);
     cx_stream_copy(file, &buf, (cx_read_func)fread, (cx_write_func)cxBufferWrite);
     fclose(file);
     
@@ -343,8 +343,9 @@
      * The list secrets->location contains urls or repo names as
      * location strings. We need a list, that contains only urls
      */
-    CxList *locations = cxLinkedListCreate(cxDefaultAllocator, (cx_compare_func)cmp_url_cred_entry, CX_STORE_POINTERS);
-    cxDefineDestructor(locations, free_cred_location);
+    CxList *locations = cxLinkedListCreate(cxDefaultAllocator, CX_STORE_POINTERS);
+    cxSetCompareFunc(locations, (cx_compare_func)cmp_url_cred_entry);
+    cxSetDestructor(locations, free_cred_location);
     CxIterator i = cxListIterator(secrets->locations);
     cx_foreach(PwdIndexEntry*, e, i) {
         CxIterator entry_iter = cxListIterator(e->locations);
@@ -364,9 +365,9 @@
     // create full request url string and remove protocol prefix
     cxmutstr req_url_proto = util_concat_path_s(cx_strcast(repo->url.value), cx_str(path));
     cxstring req_url = cx_strcast(req_url_proto);
-    if(cx_strprefix(req_url, CX_STR("http://"))) {
+    if(cx_strprefix(req_url, "http://")) {
         req_url = cx_strsubs(req_url, 7);
-    } else if(cx_strprefix(req_url, CX_STR("https://"))) {
+    } else if(cx_strprefix(req_url, "https://")) {
         req_url = cx_strsubs(req_url, 8);
     }
     
@@ -378,9 +379,9 @@
         cxstring cred_url = cx_str(cred->location);
         
         // remove protocol prefix
-        if(cx_strprefix(cred_url, CX_STR("http://"))) {
+        if(cx_strprefix(cred_url, "http://")) {
             cred_url = cx_strsubs(cred_url, 7);
-        } else if(cx_strprefix(cred_url, CX_STR("https://"))) {
+        } else if(cx_strprefix(cred_url, "https://")) {
             cred_url = cx_strsubs(cred_url, 8);
         }
         

mercurial