tree-wide: use path_split_prefix_filename() where appropriate

This commit is contained in:
Mike Yuan
2026-02-09 09:07:15 +01:00
parent 18a8ea3377
commit cc9a9d6a15
6 changed files with 22 additions and 39 deletions
+5 -6
View File
@@ -69,15 +69,14 @@ int make_lock_file_for(const char *p, int operation, LockFile *ret) {
assert(p);
assert(ret);
r = path_extract_filename(p, &fn);
r = path_split_prefix_filename(p, &dn, &fn);
if (r < 0)
return r;
r = path_extract_directory(p, &dn);
if (r < 0)
return r;
t = strjoin(dn, "/.#", fn, ".lck");
if (dn)
t = strjoin(dn, "/.#", fn, ".lck");
else
t = strjoin(".#", fn, ".lck");
if (!t)
return -ENOMEM;