index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2012-10-15 15:38:46 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2012-11-27 15:16:15 +1000 |
commit | d9e8197e60a6ffea1fd470aa746f6cc4849dac72 (patch) | |
tree | 2345fe348e6cc0aa57876b33a17f9995c17eacc8 /src | |
parent | 8054a254cb70229da30d758f57ff6203d2215eed (diff) |
-rw-r--r-- | src/util/pactree.c | 36 |
diff --git a/src/util/pactree.c b/src/util/pactree.c index 1ed40250..7b8fd93d 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -56,15 +56,15 @@ static struct graph_style graph_utf8 = { UTF_VR UTF_H, UTF_UR UTF_H, UTF_V " ", - 3 + 2 }; static struct graph_style graph_default = { " provides", - "|--", - "`--", + "|-", + "`-", "|", - 3 + 2 }; static struct graph_style graph_linear = { @@ -335,25 +335,29 @@ static void cleanup(void) static void print_text(const char *pkg, const char *provision, tdepth *depth, int last) { - const char* tip = last ? style->last : style->tip; + const char* tip = ""; int level = 0; if(!pkg && !provision) { /* not much we can do */ return; } - /* print limbs */ - while(depth->prev) { - depth = depth->prev; - } - printf("%s", color->branch1); - while(depth->next){ - printf("%*s%-*s", style->indent * (depth->level - level), "", - style->indent, style->limb); - level = depth->level + 1; - depth = depth->next; + if(depth->level > 0) { + tip = last ? style->last : style->tip; + + /* print limbs */ + while(depth->prev) { + depth = depth->prev; + } + printf("%s", color->branch1); + while(depth->next){ + printf("%*s%-*s", style->indent * (depth->level - level), "", + style->indent, style->limb); + level = depth->level + 1; + depth = depth->next; + } + printf("%*s", style->indent * (depth->level - level), ""); } - printf("%*s", style->indent * (depth->level - level), ""); /* print tip */ if(!pkg && provision) { |