path-util: fix path_simplify() with kill_dots and "."
Previously, together with kill_dots true, patch like ".", "./.", ".//.//" would all return an empty string. That is wrong. There must be one "." left to reference the current directory. Also, the comment with examples was wrong.
This commit is contained in:
committed by
Lennart Poettering
parent
c250bf671b
commit
afbae3e9f2
@@ -81,10 +81,10 @@ static void test_path(void) {
|
||||
test_path_simplify("///.//", "/.", "/");
|
||||
test_path_simplify("///.//.///", "/./.", "/");
|
||||
test_path_simplify("////.././///../.", "/.././../.", "/../..");
|
||||
test_path_simplify(".", ".", "");
|
||||
test_path_simplify("./", ".", "");
|
||||
test_path_simplify(".///.//./.", "./././.", "");
|
||||
test_path_simplify(".///.//././/", "./././.", "");
|
||||
test_path_simplify(".", ".", ".");
|
||||
test_path_simplify("./", ".", ".");
|
||||
test_path_simplify(".///.//./.", "./././.", ".");
|
||||
test_path_simplify(".///.//././/", "./././.", ".");
|
||||
test_path_simplify("//./aaa///.//./.bbb/..///c.//d.dd///..eeee/.",
|
||||
"/./aaa/././.bbb/../c./d.dd/..eeee/.",
|
||||
"/aaa/.bbb/../c./d.dd/..eeee");
|
||||
|
||||
Reference in New Issue
Block a user