Skip to content

Commit

Permalink
lxc_info: Fix -H with -c
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
stgraber committed Jan 31, 2014
1 parent 58ab99a commit 44fa8e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lxc/lxc_info.c
Expand Up @@ -338,11 +338,17 @@ static int print_info(const char *name, const char *lxcpath)
if (c->get_config_item(c, key[i], val, len + 1) != len) {
fprintf(stderr, "unable to read %s from configuration\n", key[i]);
} else {
printf("%s = %s\n", key[i], val);
if (!humanize && keys == 1)
printf("%s\n", val);
else
printf("%s = %s\n", key[i], val);
}
free(val);
} else if (len == 0) {
printf("%s =\n", key[i]);
if (!humanize && keys == 1)
printf("\n");
else
printf("%s =\n", key[i]);
} else {
fprintf(stderr, "%s invalid\n", key[i]);
}
Expand Down

0 comments on commit 44fa8e7

Please sign in to comment.