dir2list

generate a list of files shuffled by directory
git clone anongit@rnpnr.xyz:dir2list.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 9aa468dbfde259129b7f29c3831f0ef1aaf79805
Parent: 2c068b63d25ea98a49b068df276dc42c9233d30a
Author: 0x766F6964
Date:   Sun,  3 May 2020 15:43:33 -0600

add fn to print shuffled list to stdout

Diffstat:
Mmpvdir2list.c | 15+++++++++++----
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; }