diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-10 01:55:05 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 0053a470b479dffce7b4a3b3b58181831f8980e3 (patch) | |
tree | 50c01e249379c5e2b504f0bfb1481258c4d9174d /src/basic/fs-util.c | |
parent | 3ffe330ef2bb6d5ba29a7e700056354e81b847e7 (diff) |
basic/fs-util: remove logically dead code
We can jump to chase_one from two places. In the first 'todo' is set to
'buffer', which comes from path_make_absolute_cwd() and is nonnull In the
second 'todo' is set to 'joined' which is checked to be nonull a few lines
above the jump. So let's kill the code that deals with null todo there.
CID #1390941.
Diffstat (limited to 'src/basic/fs-util.c')
-rw-r--r-- | src/basic/fs-util.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 77f00820b..4e74cb7b0 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -934,25 +934,12 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags, return exists; chased_one: - if (ret) { char *c; - if (done) { - if (todo) { - c = strjoin(done, todo); - if (!c) - return -ENOMEM; - } else - c = TAKE_PTR(done); - } else { - if (todo) - c = strdup(todo); - else - c = strdup("/"); - if (!c) - return -ENOMEM; - } + c = strjoin(strempty(done), todo); + if (!c) + return -ENOMEM; *ret = c; } |