From 6157b3d146fa627e3b75f4908c4e724c31b68daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ed=C3=AAnis=20Freindorfer=20Azevedo?= Date: Wed, 15 Sep 2021 00:12:52 -0300 Subject: [PATCH] lxc-ls: list names with whitespaces in `--active`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: EdĂȘnis Freindorfer Azevedo [ small fixes ] Signed-off-by: Alexander Mikhalitsyn --- src/lxc/lxccontainer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index aeae0c31cc..41b62201b6 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -5478,14 +5478,12 @@ int list_active_containers(const char *lxcpath, char ***nret, return -1; while (getline(&line, &len, f) != -1) { - char *p = strrchr(line, ' '), *p2; - if (!p) - continue; - p++; + char *p, *p2; - if (*p != 0x40) + p = strstr(line, " @"); + if (!p) continue; - p++; + p += 2; is_hashed = false;