From: Yu Watanabe Date: Thu, 20 Jul 2023 12:17:32 +0000 (+0900) Subject: chase: drop CHASE_AT_RESOLVE_IN_ROOT earlier X-Git-Tag: v255-rc1~875^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7e957d30f7ae5318bf6c294ef796bc75ca3fe20;p=thirdparty%2Fsystemd.git chase: drop CHASE_AT_RESOLVE_IN_ROOT earlier The flag will be anyway dropped in chaseat(), but let's shortcut. --- diff --git a/src/basic/chase.c b/src/basic/chase.c index 8f9c361a098..e66070b5d11 100644 --- a/src/basic/chase.c +++ b/src/basic/chase.c @@ -511,9 +511,14 @@ int chase(const char *path, const char *root, ChaseFlags flags, char **ret_path, return -EINVAL; /* A root directory of "/" or "" is identical to "/". */ - if (empty_or_root(root)) + if (empty_or_root(root)) { root = "/"; - else { + + /* When the root directory is "/", we will drop CHASE_AT_RESOLVE_IN_ROOT in chaseat(), + * hence below is not necessary, but let's shortcut. */ + flags &= ~CHASE_AT_RESOLVE_IN_ROOT; + + } else { r = path_make_absolute_cwd(root, &root_abs); if (r < 0) return r;