fs-util: make chase_symlinks() use path_find_first_component()

The previous commit about path_compare() breaks chase_symlinks().
This commit fixes it.
This commit is contained in:
Yu Watanabe
2021-05-28 13:44:19 +09:00
parent 353df4438e
commit 39d7af99c2
2 changed files with 59 additions and 112 deletions
+2 -2
View File
@@ -332,7 +332,7 @@ static void test_chase_symlinks(void) {
assert_se(S_ISLNK(st.st_mode));
result = mfree(result);
/* Test CHASE_ONE */
/* Test CHASE_STEP */
p = strjoina(temp, "/start");
r = chase_symlinks(p, NULL, CHASE_STEP, &result, NULL);
@@ -343,7 +343,7 @@ static void test_chase_symlinks(void) {
r = chase_symlinks(p, NULL, CHASE_STEP, &result, NULL);
assert_se(r == 0);
p = strjoina(temp, "/top/./dotdota");
p = strjoina(temp, "/top/dotdota");
assert_se(streq(p, result));
result = mfree(result);