]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared/sysctl-util: normalize repeated slashes or dots to a single value
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 16 Jan 2020 14:53:57 +0000 (15:53 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 30 Jan 2020 09:48:27 +0000 (10:48 +0100)
commitf3b136a4847a0993e2dc1197779160dca4da6dac
tree53ea23e203b0d526e210ffcdc0998dbb863c2b5f
parentc16460cf781c8fe1a122cb83ad5427a014a236eb
shared/sysctl-util: normalize repeated slashes or dots to a single value

We use those strings as hash keys. While writing "a...b" looks strange,
"a///b" does not look so strange. Both syntaxes would actually result in the
value being correctly written to the file, but they would confuse our
de-deplication over keys. So let's normalize. Output also becomes nicer.

Add test.
src/shared/sysctl-util.c
src/test/meson.build
src/test/test-sysctl-util.c [new file with mode: 0644]