aboutsummaryrefslogtreecommitdiff
path: root/nodelink.c
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-05-27 22:01:58 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-05-27 22:01:58 -0400
commit945e882abbb877e704a17651c1e7e633fe668a7f (patch)
tree81d639b7822af19395fca79c5c38ea7cbb133846 /nodelink.c
parenta98c7d4ef01272e02d5cacec49a902d5da188d22 (diff)
string literal root idents unprinted link
Diffstat (limited to 'nodelink.c')
-rw-r--r--nodelink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nodelink.c b/nodelink.c
index 0aea005..2838593 100644
--- a/nodelink.c
+++ b/nodelink.c
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include "nodelink.h"
#include "strbst.h"
@@ -29,7 +30,8 @@ static void printeach(strbstnode* loc, char reprint) {
// loc->ind is the name of the connection and loc->data the link
if (!reprint) printf(" "); // indent on subnode
printlink(loc->ind, loc->data); // prints it
- if (reprint) { // and their subnodes if iterating over root tree
+ // and subnodes if iterating over root tree (except root link)
+ if (reprint && strcmp(loc->ind,"root")) {
// prints the link's target's link tree
printeach( ( (link*)loc->data)->to->links->head, 0);
}