diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-05-27 22:01:58 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-05-27 22:01:58 -0400 |
commit | 945e882abbb877e704a17651c1e7e633fe668a7f (patch) | |
tree | 81d639b7822af19395fca79c5c38ea7cbb133846 | |
parent | a98c7d4ef01272e02d5cacec49a902d5da188d22 (diff) |
string literal root idents unprinted link
-rw-r--r-- | nodelink.c | 4 | ||||
-rw-r--r-- | read.c | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -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); } @@ -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 |