mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xs-clients: fix output of "xenstore-list -p /"
When calling "xenstore-list -p /" it will prepend all listed keys with "//" instead of "/". Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
a772a005ed
commit
a3a3e7bdd7
1 file changed
+5
-1
@@ -568,13 +568,17 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
|
||||
case MODE_list: {
|
||||
unsigned int i, num;
|
||||
char **list = xs_directory(xsh, xth, argv[optind], &num);
|
||||
const char *pref = argv[optind];
|
||||
|
||||
if (list == NULL) {
|
||||
warnx("could not list path %s", argv[optind]);
|
||||
return 1;
|
||||
}
|
||||
if (prefix && !strcmp(pref, "/"))
|
||||
pref = "";
|
||||
for (i = 0; i < num; i++) {
|
||||
if (prefix)
|
||||
output("%s/", argv[optind]);
|
||||
output("%s/", pref);
|
||||
output("%s\n", list[i]);
|
||||
}
|
||||
free(list);
|
||||
|
||||