From 945e882abbb877e704a17651c1e7e633fe668a7f Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Wed, 27 May 2020 22:01:58 -0400
Subject: string literal root idents unprinted link
---
nodelink.c | 4 +++-
read.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/nodelink.c b/nodelink.c
index 0aea005..2838593 100644
--- a/nodelink.c
+++ b/nodelink.c
@@ -1,5 +1,6 @@
#include
#include
+#include
#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);
}
diff --git a/read.c b/read.c
index cd71702..b1b4789 100644
--- a/read.c
+++ b/read.c
@@ -94,7 +94,7 @@ node* readfile(char* name) {
FILE* read = fopen(name, "r");
node *root, *cur;
cur = root = newnode();
- link* curl = addbstlink(root->links, name, root);
+ link* curl = addbstlink(root->links, "root", root);
llnode start;
start.next = NULL; // empty desc isn't undefined
--
cgit