]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-bus: add comment and test in sd_bus_path_decode() for empty string
authorLuca Boccassi <bluca@debian.org>
Fri, 20 May 2022 13:00:39 +0000 (14:00 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 20 May 2022 18:44:09 +0000 (03:44 +0900)
commit54cd2d6869d20f0df3d8264168e17c31893dc0ca
treeaae9a78235c2d5172c68b9eedf3de288ec55aca9
parentcd532c633f6c317e4be1bbdc1434dd0e1665b3ea
sd-bus: add comment and test in sd_bus_path_decode() for empty string

3970         e = object_path_startswith(path, prefix);
(gdb) p path
$1 = 0x55c5a166f768 "/org/freedesktop/portable1/image"
(gdb) p prefix
$2 = 0x55c59ffc2928 "/org/freedesktop/portable1/image"
(gdb) p e
$1 = 0x5581a1675788 ""

This can be a bit confusing in certain cases, so add a comment and a
test to make the behaviour clearer and explicit.
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-bus/test-bus-marshal.c