]> git.ipfire.org Git - thirdparty/systemd.git/commit
string-util: rework empty_to_null() to not change "const" qualifier of input
authorLennart Poettering <lennart@poettering.net>
Wed, 21 Dec 2022 21:35:51 +0000 (22:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Dec 2022 21:41:16 +0000 (22:41 +0100)
commitef2409cbde3825c31b384ca0e2781d4a705ea777
tree91e6340515c2525c567c8148e5be56aba21b3551
parentcf451f382a6ebf6ad34b36939ed4f8dee1c04e61
string-util: rework empty_to_null() to not change "const" qualifier of input

This changes the definition from enpty_to_null() so that we are still
typesafe (i.e. only accept strings) but do not drop (or add) any const
to the returned string that wasn't also on the input.

Inspired by: https://github.com/systemd/systemd/pull/25805/commits/3196e2996f613a2e3568a791c503306b7c58d593
src/basic/string-util.h