From: Ivana Hutarova Varekova <varekova@redhat.com>
From: Ivana Hutarova Varekova <2e3918a0a366ea7e658a2062ab582c898a7e1b1b@redhat.com>

lscgroup: fix path name trimming

lscgroup tool in display_controller_data procedure trimmed relative path
name too strictly, thus if the path have no leading "/" sign then the first
character was trimmed too.

More precisely the relative path is taken from the full path - path to the
controller root and relative path given on command line (with all
characters "/") + character "/" at the end of path. The length of suffix
which describe relative path is count from trimmed relative path given on
command line (without characters "/" at the beginning and at the end).
There have to be used the same relative path in both cases and -1 to the
length.

CHANGELOG v1:
* more detailed description
* fix the problem with "/" sign at the end of path too

EXAMPLE
without the patch:
$ lscgroup freezer:libvirt
freezer:/ibvirt/
freezer:/ibvirt/lxc
freezer:/ibvirt/qemu

with the patch:
$ lscgroup freezer:libvirt
freezer:/libvirt/
freezer:/libvirt/lxc
freezer:/libvirt/qemu

this patch fixes the problem.

Signed-off-by: Ivana Hutarova Varekova <2e3918a0a366ea7e658a2062ab582c898a7e1b1b@redhat.com>
Acked-By: Jan Safranek<a7f4b96ffdd515ecef00f117294da18555749b0b@redhat.com>

rafalmiel/libcg,rafalmiel/libcg,rafalmiel/libcg,rafalmiel/libcg