diff actions.c @ 15:e2048e569891

insertLast returns now new inserted node; very dumb implementation for action_times
author meillo@marmaro.de
date Wed, 13 Feb 2008 09:57:07 +0100
parents 15e11eea1c66
children b62288419c1c
line wrap: on
line diff
--- a/actions.c	Wed Feb 13 09:16:01 2008 +0100
+++ b/actions.c	Wed Feb 13 09:57:07 2008 +0100
@@ -85,10 +85,16 @@
 
 unsigned char action_times(struct Node* node) {
 	struct Node* tp;
+	struct Node* last;
 	unsigned char i;
 	tp = node->down;
 	for (i = 0; i < node->value; i++) {
 		/* deep copy */
+		last = insertLast(node, newNode(tp->name, tp->value));
+		if (tp->down != NULL) {
+			last->down = newNode(tp->down->name, tp->down->value);
+		}
+
 	}
 	return 0;
 }