Sun, 16 Jul 2023 13:52:02 +0200
fix dav_add_collection_lock() setting the lock path
libidav/session.c | file | annotate | diff | comparison | revisions |
--- a/libidav/session.c Mon Jul 10 18:40:37 2023 +0200 +++ b/libidav/session.c Sun Jul 16 13:52:02 2023 +0200 @@ -534,6 +534,7 @@ return -1; } + lock->path = dav_session_strdup(sn, path); cxListAdd(locks->collection_locks, lock); cxListSort(locks->collection_locks); @@ -554,12 +555,12 @@ } CxIterator i = cxListIterator(locks->collection_locks); - cx_foreach(DavLock*, cl, i) { - int cmd = strcmp(path, cl->path); + cx_foreach(DavLock*, col_lock, i) { + int cmd = strcmp(path, col_lock->path); if(cmd == 0) { - return cl; - } else if(cx_strprefix(p, cx_str(cl->path))) { - return cl; + return col_lock; + } else if(cx_strprefix(p, cx_str(col_lock->path))) { + return col_lock; } else if(cmd > 0) { break; }