From: ken Date: Sat, 21 Jan 2017 23:13:51 +0000 (-0800) Subject: crawl_class update X-Git-Url: https://git.kengrimes.com/?p=henge%2Fapc.git;a=commitdiff_plain;h=10757d8de188be16a6d805c074ddff27e63f5b89 crawl_class update --- diff --git a/src/ir.c b/src/ir.c index 341028e..d0abf1f 100644 --- a/src/ir.c +++ b/src/ir.c @@ -672,23 +672,18 @@ void ir_test(void) static void crawl_class ( struct ir_class_t* class ) -{ wprintf("%U/\n", class->name); - if(chdir((char*)class->name)) - eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255)); - if (class->nextchild != NULL) - crawl_class(class->nextchild); - if (class->root_set != NULL) - crawl_set(class->root_set, 0); - if (class->nextsib != NULL) - { if (chdir("..")) +{ struct ir_class_t* iter; + for (iter = class->nextchild; iter != NULL; iter = iter->nextsib) + { wprintf("%U/\n", iter->name); + if(chdir((char*)iter->name)) + eprintf("CHDIR %U from %s\n",iter->name,getcwd(NULL,255)); + crawl_class(iter); + if (iter->root_set != NULL) + crawl_set(iter->root_set, 0); + uprintf("%U\\\n",iter->name); + if (chdir("..")) eprintf("CHDIR ..\n"); - crawl_class(class->nextsib); - if(chdir((char*)class->name)) - eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255)); } - uprintf("%U\\\n",class->name); - if (chdir("..")) - eprintf("CHDIR ..\n"); } static