* A path canonicaliser that doesn't depend on the existence of paths
(i.e., it doesn't use realpath(3), which is broken in any case). Therefore it doesn't resolve symlinks.
This commit is contained in:
parent
333f4963de
commit
cab3f4977a
2 changed files with 42 additions and 5 deletions
|
|
@ -71,6 +71,15 @@ void runTests()
|
|||
abort();
|
||||
} catch (BadRefError err) { };
|
||||
|
||||
/* Path canonicalisation. */
|
||||
cout << canonPath("/./../././//") << endl;
|
||||
cout << canonPath("/foo/bar") << endl;
|
||||
cout << canonPath("///foo/////bar//") << endl;
|
||||
cout << canonPath("/././/foo/////bar//.") << endl;
|
||||
cout << canonPath("/foo////bar//..///x/") << endl;
|
||||
cout << canonPath("/foo////bar//..//..//x/y/../z/") << endl;
|
||||
cout << canonPath("/foo/bar/../../../..///") << endl;
|
||||
|
||||
/* Dumping. */
|
||||
|
||||
#if 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue