i9e_attach_to_stdout(): Don't insist on btrn == NULL.
authorAndre Noll <maan@systemlinux.org>
Thu, 12 Apr 2012 04:21:56 +0000 (06:21 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 18 Nov 2012 19:28:27 +0000 (20:28 +0100)
This allows to call this function even if the stdout buffer tree node
is already attached. In this case i9e_attach_to_stdout() detaches
the current btr node first.

interactive.c

index 27763eb..f2e4a35 100644 (file)
@@ -178,7 +178,7 @@ static char **i9e_completer(const char *text, int start, __a_unused int end)
  */
 void i9e_attach_to_stdout(struct btr_node *producer)
 {
-       assert(!i9ep->stdout_btrn);
+       btr_remove_node(&i9ep->stdout_btrn);
        i9ep->stdout_btrn = btr_new_node(&(struct btr_node_description)
                EMBRACE(.name = "interactive_stdout", .parent = producer));
 }