]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-util: drop redundant condition in path_find_last_component()
authorMike Yuan <me@yhndnzj.com>
Sun, 8 Feb 2026 23:29:18 +0000 (00:29 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 9 Feb 2026 08:05:44 +0000 (09:05 +0100)
Follow-up for 3a7ba9f6b9d9a80c7f909bfbf24b5fc8c99a3176

src/basic/path-util.c

index 1b231ec6377155799113ee9d308d7c1e654521f8..6902246c97288ed3bda18cd66714c2caa1b0ed03 100644 (file)
@@ -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)