tree-wide: use path_split_prefix_filename() where appropriate
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user