]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/systemctl/systemctl.c
systemctl: fix editing of units with no fragment
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 19 Feb 2017 22:30:53 +0000 (17:30 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 19 Feb 2017 22:42:18 +0000 (17:42 -0500)
commitb3734d9841b1540c8cc81a4eca998911871a15ad
tree35e30f9d7994387afb6dba113b3df0a87711f189
parentb74df547a90a794ca75eea99238b9ae14a562720
systemctl: fix editing of units with no fragment

"systemctl --user edit --force --full tmp.mount" would crash, when we'd do
basename(NULL). Fix this by creating a new unit or a new override even if
not path is found.

Tested with:
systemctl --user edit --force --full tmp.mount
systemctl --user edit --force tmp.mount
systemctl --user edit foo@.service
systemctl --user edit foo@bar.service
systemctl --user edit --full foo@.service
systemctl --user edit --full foo@bar.service
src/systemctl/systemctl.c