Commit: 9aa468dbfde259129b7f29c3831f0ef1aaf79805
Parent: 2c068b63d25ea98a49b068df276dc42c9233d30a
Author: 0x766F6964
Date: Sun, 3 May 2020 15:43:33 -0600
add fn to print shuffled list to stdout
Diffstat:
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/mpvdir2list.c b/mpvdir2list.c
@@ -164,10 +164,14 @@ mklist(struct node *node, struct list *list)
}
static void
-recurse(struct node *node)
+printlist(struct list *list)
{
- subdir(node);
- mklist(node, list_head);
+ /* FIXME: we are allocating an extra list ptr */
+ if (!list->next)
+ return;
+
+ fprintf(stdout, "'%s'\n", list->elem);
+ printlist(list->next);
}
int
@@ -185,7 +189,10 @@ main(void)
srand(time(NULL));
- recurse(node_head);
+ subdir(node_head);
+ mklist(node_head, list_head);
+
+ printlist(list_head);
return 0;
}