]> git.tue.mpg.de Git - paraslash.git/commitdiff
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 27763eb3c16a819c39479e9411c7fd6109571396..f2e4a355012ce1aa3861ba8b7bec56443a80df8e 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));
 }