From: Mike Yuan Date: Sun, 8 Feb 2026 23:29:18 +0000 (+0100) Subject: path-util: drop redundant condition in path_find_last_component() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=294855953cccddab0aab3155baccb55c66900d29;p=thirdparty%2Fsystemd.git path-util: drop redundant condition in path_find_last_component() Follow-up for 3a7ba9f6b9d9a80c7f909bfbf24b5fc8c99a3176 --- diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 1b231ec6377..6902246c972 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -1027,8 +1027,7 @@ int path_find_last_component(const char *path, bool accept_dot_dot, const char * q = path + strlen(path) - 1; q = skip_slash_or_dot_backward(path, q); - if (!q || /* the root directory */ - (q == path && *q == '.')) { /* path is "." or "./" */ + if (!q) { /* the root directory, "." or "./" */ if (next) *next = path; if (ret)