From: EdĂȘnis Freindorfer Azevedo Date: Wed, 15 Sep 2021 03:12:52 +0000 (-0300) Subject: lxc-ls: list names with whitespaces in `--active`. X-Git-Tag: v6.0.0~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4422%2Fhead;p=thirdparty%2Flxc.git lxc-ls: list names with whitespaces in `--active`. Fixes: #3970 Signed-off-by: EdĂȘnis Freindorfer Azevedo [ small fixes ] Signed-off-by: Alexander Mikhalitsyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index aeae0c31c..41b62201b 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;