From: Jordan Date: Sat, 21 Jan 2017 23:15:38 +0000 (-0800) Subject: Merge branch 'master' of krull:apc X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fapc.git;a=commitdiff_plain;h=9206db0d6a4c2eea5e053aa517045b2132362812;hp=f90be96540a049b7dea80a82ffdd6d620ddf154a Merge branch 'master' of krull:apc --- 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