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>
Wed, 5 Feb 2020 14:04:44 +0000 (15:04 +0100)
commitc2e304681929fea79ce8e9c5a1e00cd2f293a72d
treef3073c73782347cf4dd3db5277a1ad4de771f9ca
parent6f4364046f90430aeede4789f016ae1644a292bf
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.

(cherry picked from commit f3b136a4847a0993e2dc1197779160dca4da6dac)
src/shared/sysctl-util.c
src/test/meson.build
src/test/test-sysctl-util.c [new file with mode: 0644]