]> git.ipfire.org Git - thirdparty/systemd.git/commit
basic/path-util: make path_simplify() skip leading '/..'
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Sep 2023 14:52:54 +0000 (16:52 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Sep 2023 16:01:03 +0000 (18:01 +0200)
commit003ccba65072a74c18e3e45d4c1f8ea7346b2f01
tree020f017992c06e6f14ab550abedf9b032828fdaa
parenta410b3a3d41f327d0c7265748ae27109f1b8239a
basic/path-util: make path_simplify() skip leading '/..'

I.e., /.. becomes /, /../foo becomes /foo, /../../bar becomes /bar, etc. We can
do this unconditionally, without access to the file system, because the parent
of the root directory always resolves to. /.. in other places is handled as
before, because resolving it properly would require access to the file system
which we don't want to do in path_simplify().
src/basic/path-util.c
src/test/test-path-util.c