From bbaad1e5a8537b1226e261ed7a468c1e48fc0851 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Fri, 24 Dec 2010 13:10:13 +0100 Subject: [PATCH] genconf: fix path display (no slash at the end) Signed-off-by: Olivier Matz --- src/genconf/confnode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/genconf/confnode.c b/src/genconf/confnode.c index 3af3cd3..6a85953 100644 --- a/src/genconf/confnode.c +++ b/src/genconf/confnode.c @@ -468,21 +468,21 @@ void confnode_display_long(const struct confnode *n) confnode_check_deps(n, 1); } -void __conf_display_path(const struct confnode *n) +static void __conf_display_path(const struct confnode *n, int first) { if (n->parent) - __conf_display_path(n->parent); + __conf_display_path(n->parent, 0); if (n->flags & CONFNODE_F_IS_ROOT) printf("/"); else if (!(n->flags & CONFNODE_F_INVISIBLE)) - printf("%s/", n->name); + printf("%s%s", n->name, first ? "" : "/" ); } /* show path: used by the 'pwd' command. Nodes like 'if' are * ignored. */ void conf_display_path(const struct confnode *n) { - __conf_display_path(n); + __conf_display_path(n, 1); printf("\n"); } -- 2.20.1