# HG changeset patch # User meillo@marmaro.de # Date 1204389955 -3600 # Node ID e986c6abed2bed962c90641a8f68824768dac594 # Parent 2e564bf8599c9b791596960d0feb5f3a8326cff4 eliminated generic blackhole node at root diff -r 2e564bf8599c -r e986c6abed2b baum.c --- a/baum.c Sat Mar 01 17:36:59 2008 +0100 +++ b/baum.c Sat Mar 01 17:45:55 2008 +0100 @@ -138,8 +138,7 @@ strcpy(name, ""); value = 0; last_indent = -1; - root = newNode("blackhole", 0); - last_node = root; + last_node = NULL; file = fopen(filename, "r"); while ((c = getc(file)) != EOF) { @@ -167,7 +166,12 @@ fprintf(stderr, "error: Indention over more than one level. Only indent by one!\n"); exit(5); } - last_node->down = node; + if (last_node == NULL) { + root = node; + last_node = root; + } else { + last_node->down = node; + } push(last_node); } else if (indent == last_indent) { /* right */ last_node->right = node; @@ -263,6 +267,7 @@ } shell_return = action(root); + fflush(stdout); if (option_verbose) { printTree(root, 0);